Skip to content

Commit d90ffc2

Browse files
committed
Set cython language level to 3
Otherwise it fails to convert unicode to 'str': ``` Error compiling Cython file: ------------------------------------------------------------ ... if metadata_request_timeout is None: return stmt ms = int(metadata_request_timeout / datetime.timedelta(milliseconds=1)) if ms == 0: return stmt return f"{stmt} USING TIMEOUT {ms}ms" ^ ------------------------------------------------------------ cassandra/util.py:1813:11: Cannot convert Unicode string to 'str' implicitly. This is not portable and requires explicit encoding. ```
1 parent be3c037 commit d90ffc2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,14 @@ def _setup_extensions(self):
325325
extra_compile_args=compile_args)
326326
for m in cython_candidates],
327327
nthreads=build_concurrency,
328-
exclude_failures=True))
328+
compiler_directives={'language_level': 3},
329+
))
329330

330-
self.extensions.extend(cythonize(NoPatchExtension("*", ["cassandra/*.pyx"], extra_compile_args=compile_args),
331-
nthreads=build_concurrency))
331+
self.extensions.extend(cythonize(
332+
NoPatchExtension("*", ["cassandra/*.pyx"], extra_compile_args=compile_args),
333+
nthreads=build_concurrency,
334+
compiler_directives={'language_level': 3},
335+
))
332336
except Exception:
333337
sys.stderr.write("Failed to cythonize one or more modules. These will not be compiled as extensions (optional).\n")
334338

0 commit comments

Comments
 (0)