Commit 6d6b1c10 authored by Julien Muchembled's avatar Julien Muchembled

Fix Py3 build when Cython is not available

parent 88a3877f
# cython: c_string_encoding=utf8
from cpython cimport (PyObject, PY_LONG_LONG,
PyBytes_FromStringAndSize as _PyBytes_FromStringAndSize,
PyBytes_AS_STRING as _PyBytes_AS_STRING)
......@@ -37,11 +39,7 @@ def getFrameContentSize(bytes string not None):
return _getFrameContentSize(_PyBytes_AS_STRING(string), len(string))
def getErrorName(code):
# why can't I just cast to str ?
IF str is bytes:
return ZSTD_getErrorName(code)
ELSE:
return ZSTD_getErrorName(code).decode()
return <str>ZSTD_getErrorName(code)
global error
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment