diff options
| author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2025-05-26 19:28:40 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-11-22 00:01:28 +1100 |
| commit | 3b2b8dd53826ef3b7ef755013e1ecdccd368cb8c (patch) | |
| tree | 97acdba6fe6447393401338dd87e450769e3bce1 /tests/cmdline/cmd_file_variable.py.exp | |
| parent | 5b3c928f53a0f0e2a1d6178569e594dbe9cf8f92 (diff) | |
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>
Diffstat (limited to 'tests/cmdline/cmd_file_variable.py.exp')
| -rw-r--r-- | tests/cmdline/cmd_file_variable.py.exp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/cmdline/cmd_file_variable.py.exp b/tests/cmdline/cmd_file_variable.py.exp new file mode 100644 index 000000000..6807569f6 --- /dev/null +++ b/tests/cmdline/cmd_file_variable.py.exp @@ -0,0 +1 @@ +__file__ = cmdline/cmd_file_variable.py |
