diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-03 10:33:13 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-03 10:33:13 +0100 |
commit | 24637421ec9bdf92b0faba3a9d3fe1df6d9ac94d (patch) | |
tree | 1e6f2b2fd045633c07869c23003dda3e7ea9631d /setup.py | |
parent | 3f91a4230cd54382a8819e7aeb407752d0eee33c (diff) | |
download | buildstream-24637421ec9bdf92b0faba3a9d3fe1df6d9ac94d.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.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) |