mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3536 from Naereen/patch-1
Prevent a TypeError bug for get_full_modname()
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user