diff --git a/CodeGenerator/templates/GithubObject.py b/CodeGenerator/templates/GithubObject.py index 7750ab97..7e6e9d10 100644 --- a/CodeGenerator/templates/GithubObject.py +++ b/CodeGenerator/templates/GithubObject.py @@ -72,12 +72,12 @@ class {{ class.name }}( object ): {% else %} {% if method.type.cardinality == "scalar" %} - return {{ method.type.name }}.{{ method.type.name }}( self.__github, result, lazy = True ) + return {% if method.type.name != class.name %}{{ method.type.name }}.{% endif %}{{ method.type.name }}( self.__github, result, lazy = True ) {% endif %} {% if method.type.cardinality == "list" %} return [ - {{ method.type.name }}.{{ method.type.name }}( self.__github, element, lazy = True ) + {% if method.type.name != class.name %}{{ method.type.name }}.{% endif %}{{ method.type.name }}( self.__github, element, lazy = True ) for element in result ] {% endif %} diff --git a/github/GithubObjects/NamedUser.py b/github/GithubObjects/NamedUser.py index 32c88147..b74ca93f 100644 --- a/github/GithubObjects/NamedUser.py +++ b/github/GithubObjects/NamedUser.py @@ -212,7 +212,7 @@ class NamedUser( object ): None ) return [ - NamedUser.NamedUser( self.__github, element, lazy = True ) + NamedUser( self.__github, element, lazy = True ) for element in result ] @@ -224,7 +224,7 @@ class NamedUser( object ): None ) return [ - NamedUser.NamedUser( self.__github, element, lazy = True ) + NamedUser( self.__github, element, lazy = True ) for element in result ] diff --git a/github/GithubObjects/Repository.py b/github/GithubObjects/Repository.py index d2e6d8e1..f4e6b4d5 100644 --- a/github/GithubObjects/Repository.py +++ b/github/GithubObjects/Repository.py @@ -393,7 +393,7 @@ class Repository( object ): None ) return [ - Repository.Repository( self.__github, element, lazy = True ) + Repository( self.__github, element, lazy = True ) for element in result ]