We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7954bac commit 0011e7fCopy full SHA for 0011e7f
astroid/nodes/scoped_nodes/scoped_nodes.py
@@ -354,7 +354,9 @@ def getattr(
354
if name in self.special_attributes and not ignore_locals and not name_in_locals:
355
result = [self.special_attributes.lookup(name)]
356
if name == "__name__":
357
- result.append(const_factory("__main__"))
+ main_const = const_factory("__main__")
358
+ main_const.parent = AstroidManager().builtins_module
359
+ result.append(main_const)
360
elif not ignore_locals and name_in_locals:
361
result = self.locals[name]
362
elif self.package:
0 commit comments