Fix usage on embedded Python
authorChristian Sandberg <christiansandberg@me.com>
Wed, 20 Sep 2017 13:27:29 +0000 (15:27 +0200)
committerWilliam Deegan <bill@baddogconsulting.com>
Sun, 24 Sep 2017 19:20:30 +0000 (12:20 -0700)
First entry in sys.path is not always the script directory.

src/script/scons.py

index bdf0ceab498feeaeb23539c880127364158e1781..f2a44f8b665b3a6d5d5fa1422b7cd42920e76791 100644 (file)
@@ -65,7 +65,7 @@ Python < 3.5 is not yet supported.\n"
     sys.exit(1)
 
 
-script_dir = sys.path[0]
+script_dir = os.path.dirname(os.path.realpath(__file__))
 
 if script_dir in sys.path:
     sys.path.remove(script_dir)