mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-27 10:22:18 +08:00
Fix: __module__ doesn't need to be properly defined.
This commit is contained in:
@@ -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:
|
||||||
return __import__(imp_plz)
|
try:
|
||||||
|
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