Merge pull request #3536 from Naereen/patch-1

Prevent a TypeError bug for get_full_modname()
This commit is contained in:
Takeshi KOMIYA
2017-03-11 09:27:36 +09:00
committed by GitHub

View File

@@ -282,6 +282,10 @@ def get_module_source(modname):
def get_full_modname(modname, attribute):
# type: (str, unicode) -> unicode
if modname is None:
# Prevents a TypeError: if the last getattr() call will return None
# then it's better to return it directly
return None
__import__(modname)
module = sys.modules[modname]