mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Improve type asserts on lists
This commit is contained in:
@@ -61,7 +61,7 @@ class GitCommit( object ):
|
||||
assert isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ]
|
||||
self.__message = attributes[ "message" ]
|
||||
if "parents" in attributes and attributes[ "parents" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "parents" ], list ) and ( len( attributes[ "parents" ] ) == 0 or isinstance( attributes[ "parents" ][ 0 ], dict ) ), attributes[ "parents" ]
|
||||
assert all( isinstance( element, dict ) for element in attributes[ "parents" ] ), attributes[ "parents" ]
|
||||
self.__parents = [
|
||||
GitCommit( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "parents" ]
|
||||
|
||||
Reference in New Issue
Block a user