Skip to content

Commit b79b2e9

Browse files
committed
Add __file__ in run context
1 parent 48eb0ed commit b79b2e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pymode/run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def run_code():
2828
lines.pop(ix)
2929

3030
context = dict(
31-
__name__='__main__', input=env.user_input, raw_input=env.user_input)
31+
__name__='__main__',
32+
__file__=env.var('expand("%:p")'),
33+
input=env.user_input,
34+
raw_input=env.user_input)
3235

3336
sys.stdout, stdout_ = StringIO(), sys.stdout
3437
sys.stderr, stderr_ = StringIO(), sys.stderr

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy