mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Reduce differences between generated code and correct code
This commit is contained in:
@@ -45,7 +45,6 @@ class Label( object ):
|
||||
)
|
||||
self.__useAttributes( data )
|
||||
|
||||
# @todo Remove '_identity' from the normalized json description
|
||||
@property
|
||||
def _identity( self ):
|
||||
return urllib.quote( self.name )
|
||||
@@ -56,7 +55,6 @@ class Label( object ):
|
||||
self.__url = None
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "color" in attributes and attributes[ "color" ] is not None: # pragma no branch
|
||||
self.__color = attributes[ "color" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
|
||||
@@ -240,11 +240,15 @@ class PullRequest( object ):
|
||||
return status == 204
|
||||
|
||||
def merge( self, commit_message = DefaultValueForOptionalParameters ):
|
||||
post_parameters = {
|
||||
}
|
||||
if commit_message is not DefaultValueForOptionalParameters:
|
||||
post_parameters[ "commit_message" ] = commit_message
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/merge",
|
||||
None,
|
||||
{}
|
||||
post_parameters
|
||||
)
|
||||
|
||||
def __initAttributes( self ):
|
||||
|
||||
@@ -584,7 +584,7 @@ class Repository( object ):
|
||||
def get_git_ref( self, ref ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/git" + "/" + str( ref ),
|
||||
str( self.url ) + "/git/" + str( ref ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user