mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Modules are obviously not executable, but should not lead to traceback when executed
This commit is contained in:
@@ -108,7 +108,7 @@ class StdlibPlugin(BasePlugin):
|
|||||||
else:
|
else:
|
||||||
if context.parent_context == self._evaluator.builtins_module:
|
if context.parent_context == self._evaluator.builtins_module:
|
||||||
module_name = 'builtins'
|
module_name = 'builtins'
|
||||||
elif context.parent_context.is_module():
|
elif context.parent_context is not None and context.parent_context.is_module():
|
||||||
module_name = context.parent_context.name.string_name
|
module_name = context.parent_context.name.string_name
|
||||||
else:
|
else:
|
||||||
return callback(context, arguments=arguments)
|
return callback(context, arguments=arguments)
|
||||||
|
|||||||
@@ -295,6 +295,11 @@ __file__
|
|||||||
#? ['__file__']
|
#? ['__file__']
|
||||||
__file__
|
__file__
|
||||||
|
|
||||||
|
#? str()
|
||||||
|
math.__file__
|
||||||
|
# Should not lead to errors
|
||||||
|
#?
|
||||||
|
math()
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# with statements
|
# with statements
|
||||||
|
|||||||
Reference in New Issue
Block a user