diff options
author | Christian Tismer <tismer@stackless.com> | 2018-02-24 17:40:50 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2018-02-26 09:09:48 +0000 |
commit | 9a303ce55632225fa1b884461c133b1caf00a387 (patch) | |
tree | f9f22ad6018069c079d1d58bb717bba12b6ffe2a /setup.py | |
parent | ad6766eee85e124bd7661f78388a8f13a5a1a0b2 (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.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |