py.run
: __name__
is "builtins"
, should be "__main__"
#4928
Labels
py.run
: __name__
is "builtins"
, should be "__main__"
#4928
Bug Description
Python's
exec()
has__name__
set to__main__
:When running the same code through PyO3's
py.run()
, it'll givebuiltins
.Steps to Reproduce
See above.
Backtrace
Your operating system and version
Linux 6.12.13-1-lts
Your Python version (
python --version
)Python 3.11.11
Your Rust version (
rustc --version
)rustc 1.85.0 (4d91de4e4 2025-02-17) (Arch Linux rust 1:1.85.0-1)
Your PyO3 version
v0.23.4
How did you install python? Did you use a virtualenv?
uv venv
Additional Info
No response
The text was updated successfully, but these errors were encountered: