aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2018-02-24 17:40:50 +0100
committerChristian Tismer <tismer@stackless.com>2018-02-26 09:09:48 +0000
commit9a303ce55632225fa1b884461c133b1caf00a387 (patch)
treef9f22ad6018069c079d1d58bb717bba12b6ffe2a /setup.py
parentad6766eee85e124bd7661f78388a8f13a5a1a0b2 (diff)
setup.py: Distinguish debug/release Python
When developing the heap types, I had to switch between debug and release Python very often. This patch allows for debug and release to co-exist without re-building everything. Additionally to the 'd' that gets appended to the build and install folders, I used a 'p' for debug Python. Please feel free to change that as you like. Change-Id: I022face5177bb69589809c8b235f09161d7fabd2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 03e8d780..d7819744 100644
--- a/setup.py
+++ b/setup.py
@@ -402,6 +402,9 @@ Use --list-versions option to get list of available versions""" % OPTION_VERSION
sys.exit(1)
__version__ = OPTION_VERSION
+def is_debug_python():
+ return getattr(sys, "gettotalrefcount", None) is not None
+
# Return a prefix suitable for the _install/_build directory
def prefix():
virtualEnvName = os.environ.get('VIRTUAL_ENV', None)
@@ -409,6 +412,8 @@ def prefix():
name += str(sys.version_info[0])
if OPTION_DEBUG:
name += 'd'
+ if is_debug_python():
+ name += 'p'
return name
# Initialize, pull and checkout submodules