diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-03-12 01:06:34 +0100 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-03-14 09:39:40 +0000 |
commit | 7113511b42b45a7a00b287f3a45e1d897a1c6e45 (patch) | |
tree | 3a9e0e07a0d89fb81f9e1f31e32fbfee8d1c072d /setup.py | |
parent | d30161e81f6d2c3cc95c6ced2d5248de56f7eedc (diff) |
Fix path to script_dir
Make sure to cd into setup.py folder.
Change-Id: Ic777b78028c3f2ecfa739a1c72df031b753083a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -130,6 +130,15 @@ import os import time from utils import memoize, has_option, get_python_dict OPTION_SNAPSHOT_BUILD = has_option("snapshot-build") + +# Change the cwd to setup.py's dir. +try: + this_file = __file__ +except NameError: + this_file = sys.argv[0] +this_file = os.path.abspath(this_file) +if os.path.dirname(this_file): + os.chdir(os.path.dirname(this_file)) script_dir = os.getcwd() @memoize @@ -346,15 +355,6 @@ if OPTION_ICULIB: if not OPTION_STANDALONE: print("--iculib-url option is a no-op option and will be removed soon.") -# Change the cwd to our source dir -try: - this_file = __file__ -except NameError: - this_file = sys.argv[0] -this_file = os.path.abspath(this_file) -if os.path.dirname(this_file): - os.chdir(os.path.dirname(this_file)) - def is_debug_python(): return getattr(sys, "gettotalrefcount", None) is not None |