diff --git a/IntegrationTest.py b/IntegrationTest.py index 2a23bec3..036254aa 100644 --- a/IntegrationTest.py +++ b/IntegrationTest.py @@ -64,7 +64,9 @@ class ReplayingHttpsConnection: def request( self, verb, url, input, headers ): del headers[ "Authorization" ] - if( self.__file.readline().strip() != verb + " " + url + " " + str( headers ) + " " + input ): + expectation = self.__file.readline().strip() + if expectation != verb + " " + url + " " + str( headers ) + " " + input: + # print expectation, "!=", verb + " " + url + " " + str( headers ) + " " + input raise RecordReplayException( "This test has been changed since last record. Please re-run this script with argument '--record'" ) def getresponse( self ): @@ -569,4 +571,5 @@ class IntegrationTest: def printList( self, title, iterable, f = lambda x: x ): print title + ":", ", ".join( str( f( x ) ) for x in iterable[ :10 ] ), "..." if len( iterable ) > 10 else "" +sys.setrecursionlimit( 50 ) IntegrationTest().main( sys.argv[ 1: ] ) diff --git a/github/GithubObjects/GitTree.py b/github/GithubObjects/GitTree.py index 87666f3f..61dac784 100644 --- a/github/GithubObjects/GitTree.py +++ b/github/GithubObjects/GitTree.py @@ -2,7 +2,7 @@ from GithubObject import * GitTree = GithubObject( "GitTree", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha + "?recursive=1" if obj.recursive else "" ), + BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha + ( "?recursive=1" if obj.recursive else "" ) ), InternalSimpleAttributes( "sha", "url", "tree", diff --git a/github/GithubObjects/Repository.py b/github/GithubObjects/Repository.py index 253cb901..8dcb824c 100644 --- a/github/GithubObjects/Repository.py +++ b/github/GithubObjects/Repository.py @@ -18,6 +18,7 @@ from Branch import * from PullRequest import * __modifyAttributesForObjectsReferingRepo = { "_repo": lambda repo: repo } +__modifyAttributesForGitTree = { "_repo": lambda repo: repo, "recursive": lambda repo: False } def __compare( repo, base, head ): return repo._github._dataRequest( "GET", repo._baseUrl() + "/compare/" + base + "..." + head, None, None ) @@ -89,8 +90,8 @@ Repository._addAttributePolicy( SeveralAttributePolicies( [ ElementCreatable( Parameters( [ "message", "tree", "parents" ], [ "author", "committer" ] ), __modifyAttributesForObjectsReferingRepo ) ), ExternalListOfObjects( "git/trees", "git_tree", GitTree, - ElementGetable( Parameters( [ "sha" ], [ "recursive" ] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "tree" ], [ "base_tree" ] ), __modifyAttributesForObjectsReferingRepo ) + ElementGetable( Parameters( [ "sha" ], [ "recursive" ] ), __modifyAttributesForGitTree ), + ElementCreatable( Parameters( [ "tree" ], [ "base_tree" ] ), __modifyAttributesForGitTree ) ), ExternalListOfObjects( "git/blobs", "git_blob", GitBlob, ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ),