aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-03-12 01:06:34 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-03-14 09:39:40 +0000
commit7113511b42b45a7a00b287f3a45e1d897a1c6e45 (patch)
tree3a9e0e07a0d89fb81f9e1f31e32fbfee8d1c072d /setup.py
parentd30161e81f6d2c3cc95c6ced2d5248de56f7eedc (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.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 559e9286f..35746e651 100644
--- a/setup.py
+++ b/setup.py
@@ -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