Skip to content

Commit 181a21c

Browse files
committed
Add explicit declaration of CYTHON_CLINE_IN_TRACEBACK macro
1 parent ca4a85a commit 181a21c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

setup.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88

99
# Defining setup variables:
10-
defined_macros = list()
10+
defined_macros = dict()
11+
defined_macros['CYTHON_CLINE_IN_TRACEBACK'] = 0
1112

1213
# Getting description:
1314
with open('README.rst') as readme_file:
@@ -23,8 +24,9 @@
2324

2425
# Adding debug options:
2526
if os.environ.get('DEPENDENCY_INJECTOR_DEBUG_MODE') == '1':
26-
defined_macros.append(('CYTHON_TRACE', 1))
27-
defined_macros.append(('CYTHON_TRACE_NOGIL', 1))
27+
defined_macros['CYTHON_TRACE'] = 1
28+
defined_macros['CYTHON_TRACE_NOGIL'] = 1
29+
defined_macros['CYTHON_CLINE_IN_TRACEBACK'] = 1
2830

2931

3032
setup(name='dependency-injector',
@@ -47,11 +49,11 @@
4749
ext_modules=[
4850
Extension('dependency_injector.containers',
4951
['src/dependency_injector/containers.c'],
50-
define_macros=defined_macros,
52+
define_macros=list(defined_macros.items()),
5153
extra_compile_args=['-O2']),
5254
Extension('dependency_injector.providers',
5355
['src/dependency_injector/providers.c'],
54-
define_macros=defined_macros,
56+
define_macros=list(defined_macros.items()),
5557
extra_compile_args=['-O2']),
5658
],
5759
package_data={

0 commit comments

Comments
 (0)