From b2b0ce384d8438cb9378bb5d8ad6cd800f7586ea Mon Sep 17 00:00:00 2001 From: Jakob Reschke Date: Sat, 26 Sep 2015 17:34:37 +0200 Subject: [PATCH] supply PYTHONPATH to the terminal started from .build/shell.py --- .build/shell.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.build/shell.py b/.build/shell.py index 4e1a95cd..63fbbfad 100755 --- a/.build/shell.py +++ b/.build/shell.py @@ -6,5 +6,11 @@ import environment, code print "\033[33;5;7m \nUse terminal() to drop into a system console\n \033[0m" def terminal(): + module_path = os.path.abspath(os.path.dirname(__file__)) + if module_path in sys.path: + paths = sys.path[:sys.path.index(module_path)] + else: + paths = sys.path + os.putenv("PYTHONPATH", os.pathsep.join(paths)) os.system(os.environ.get("COMSPEC") or os.environ.get("SHELL") or "/bin/sh") code.interact(local=locals())