Fix: __module__ doesn't need to be properly defined.
This commit is contained in:
1 parent
b2a691a69a
commit
9a93d599da
1 file changed
+4
@@ -68,7 +68,11 @@ def get_module(obj):
|
|||||||
# Happens for example in `(_ for _ in []).send.__module__`.
|
# Happens for example in `(_ for _ in []).send.__module__`.
|
||||||
return builtins
|
return builtins
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
return __import__(imp_plz)
|
return __import__(imp_plz)
|
||||||
|
except ImportError:
|
||||||
|
# __module__ can be something arbitrary that doesn't exist.
|
||||||
|
return builtins
|
||||||
|
|
||||||
|
|
||||||
def _faked(module, obj, name):
|
def _faked(module, obj, name):
|
||||||
|
|||||||
Reference in new issue
Block a user