Commit 3b2b8dd
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>1 parent 5b3c928 commit 3b2b8dd
3 files changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments