Skip to content

Commit 6033234

Browse files
committed
Add curdir to sys.path when code running
1 parent 60cc4f5 commit 6033234

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymode/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def run_code():
2020
:returns: None
2121
2222
"""
23-
2423
errors, err = [], ''
2524
line1, line2 = env.var('a:line1'), env.var('a:line2')
2625
lines = __prepare_lines(line1, line2)
@@ -36,7 +35,9 @@ def run_code():
3635

3736
try:
3837
code = compile('\n'.join(lines) + '\n', env.curbuf.name, 'exec')
38+
sys.path.insert(0, env.curdir)
3939
exec(code, context) # noqa
40+
sys.path.pop(0)
4041

4142
except SystemExit as e:
4243
if e.code:

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