Skip to content

Commit 64e452d

Browse files
committed
3.6 compatibility: the cwd should go first in sys.path...
1 parent 8b3ec4b commit 64e452d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

macro_extras/macropy3

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def import_module_as_main(name, script_mode):
7575
# pass
7676

7777
if "" not in sys.path: # Python 3.6 seems to have removed the special entry "" (the cwd) from sys.path
78-
sys.path.append("")
78+
# Placing it first overrides installed unpythonic with the local one when running tests
79+
# (the installed one won't have the "test" submodules).
80+
sys.path.insert(0, "")
7981

8082
# path should be folder containing something.py if we are being run as "pydialect something.py" (script_mode=True), and cwd if run as "pydialect -m something"
8183
path = None

0 commit comments

Comments
 (0)