mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
shared/runtime/pyexec: Set __file__ for file input when enabled.
When `MICROPY_MODULE___FILE__` is enabled and parsing file input, set the global `__file__` variable to the source filename. This matches the behavior of the unix port and provides the current filename to the executing script. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
committed by
Damien George
parent
5b3c928f53
commit
3b2b8dd538
1
tests/cmdline/cmd_file_variable.py.exp
Normal file
1
tests/cmdline/cmd_file_variable.py.exp
Normal file
@@ -0,0 +1 @@
|
||||
__file__ = cmdline/cmd_file_variable.py
|
||||
Reference in New Issue
Block a user