aboutsummaryrefslogtreecommitdiffstats
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-19 08:42:18 +0000
commit2ae5f1d37bfe8757836a5c091a032ba94760bda0 (patch)
tree92adc2eb36dbb2e08fa3d9cfe2a80ae3faa27d6f
parentf23adec5c47f888542bf92820c98769c6e2d2cf0 (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> (cherry picked from commit 7113511b42b45a7a00b287f3a45e1d897a1c6e45)
-rw-r--r--setup.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index 5f5235da3..30190acd5 100644
--- a/setup.py
+++ b/setup.py
@@ -129,6 +129,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()
@@ -354,20 +363,8 @@ 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))
-
-if OPTION_NOEXAMPLES:
- # Remove pyside2-examples from submodules so they will not be included.
- for idx, item in enumerate(submodules):
- if item[0].startswith('pyside2-examples'):
- del submodules[idx]
+def is_debug_python():
+ return getattr(sys, "gettotalrefcount", None) is not None
# Return a prefix suitable for the _install/_build directory
def prefix():