There was an error while loading. Please reload this page.
1 parent af5e90a commit 14669c0Copy full SHA for 14669c0
1 file changed
bpython/args.py
@@ -243,10 +243,10 @@ def exec_code(
243
raise SystemExit(e.errno)
244
old_argv, sys.argv = sys.argv, args
245
sys.path.insert(0, os.path.abspath(os.path.dirname(args[0])))
246
- spec = importlib.util.spec_from_loader("__console__", loader=None)
+ spec = importlib.util.spec_from_loader("__main__", loader=None)
247
assert spec
248
mod = importlib.util.module_from_spec(spec)
249
- sys.modules["__console__"] = mod
+ sys.modules["__main__"] = mod
250
interpreter.locals.update(mod.__dict__) # type: ignore # TODO use a more specific type that has a .locals attribute
251
interpreter.locals["__file__"] = args[0] # type: ignore # TODO use a more specific type that has a .locals attribute
252
interpreter.runsource(source, args[0], "exec")
0 commit comments