From 181a21cb26c96f40abbc6a0889ff1f47ae38ab36 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Tue, 8 Aug 2017 19:27:33 +0300 Subject: [PATCH] Add explicit declaration of CYTHON_CLINE_IN_TRACEBACK macro --- setup.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 71fb3286..768eae5c 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,8 @@ from setuptools import setup, Extension # Defining setup variables: -defined_macros = list() +defined_macros = dict() +defined_macros['CYTHON_CLINE_IN_TRACEBACK'] = 0 # Getting description: with open('README.rst') as readme_file: @@ -23,8 +24,9 @@ with open('src/dependency_injector/__init__.py') as init_file: # Adding debug options: if os.environ.get('DEPENDENCY_INJECTOR_DEBUG_MODE') == '1': - defined_macros.append(('CYTHON_TRACE', 1)) - defined_macros.append(('CYTHON_TRACE_NOGIL', 1)) + defined_macros['CYTHON_TRACE'] = 1 + defined_macros['CYTHON_TRACE_NOGIL'] = 1 + defined_macros['CYTHON_CLINE_IN_TRACEBACK'] = 1 setup(name='dependency-injector', @@ -47,11 +49,11 @@ setup(name='dependency-injector', ext_modules=[ Extension('dependency_injector.containers', ['src/dependency_injector/containers.c'], - define_macros=defined_macros, + define_macros=list(defined_macros.items()), extra_compile_args=['-O2']), Extension('dependency_injector.providers', ['src/dependency_injector/providers.c'], - define_macros=defined_macros, + define_macros=list(defined_macros.items()), extra_compile_args=['-O2']), ], package_data={