summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-03 10:33:13 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-03 10:33:13 +0100
commit24637421ec9bdf92b0faba3a9d3fe1df6d9ac94d (patch)
tree1e6f2b2fd045633c07869c23003dda3e7ea9631d
parent3f91a4230cd54382a8819e7aeb407752d0eee33c (diff)
downloadbuildstream-bschubert/fix-cython-trace.tar.gz
setup.py: Be more restrictive with BST_CYTHON_TRACE valuesbschubert/fix-cython-trace
"0" evaluates to 'True' in python, which incorrectly switched on the BST_CYTHON_TRACE. Forcing an int for this environment variable allows us to ensure we are correct.
-rwxr-xr-xsetup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index ad87932fb..ed211dd09 100755
--- a/setup.py
+++ b/setup.py
@@ -324,7 +324,12 @@ def assert_cython_required():
raise SystemExit(1)
-ENABLE_CYTHON_TRACE = os.environ.get("BST_CYTHON_TRACE", "0")
+try:
+ ENABLE_CYTHON_TRACE = int(os.environ.get("BST_CYTHON_TRACE", "0"))
+except ValueError:
+ print("BST_CYTHON_TRACE must be an integer. Please set it to '1' to enable, '0' to disable", file=sys.stderr)
+ raise SystemExit(1)
+
extension_macros = [
("CYTHON_TRACE", ENABLE_CYTHON_TRACE)