Commit 11d636dc authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents 78b799d0 a57de922
...@@ -396,7 +396,7 @@ Other changes ...@@ -396,7 +396,7 @@ Other changes
* Support for Python 2.6 was removed. * Support for Python 2.6 was removed.
0.29.18 (2020-0?-??) 0.29.18 (2020-05-18)
==================== ====================
Bugs fixed Bugs fixed
......
...@@ -165,13 +165,13 @@ def cmod(a, b): ...@@ -165,13 +165,13 @@ def cmod(a, b):
def cast(t, *args, **kwargs): def cast(t, *args, **kwargs):
kwargs.pop('typecheck', None) kwargs.pop('typecheck', None)
assert not kwargs assert not kwargs
if isinstance(t, typedef): if isinstance(t, typedef):
return t(*args) return t(*args)
elif isinstance(t, type): #Doesn't work with old-style classes of Python 2.x elif isinstance(t, type): #Doesn't work with old-style classes of Python 2.x
if len(args) != 1 or not (args[0] is None or isinstance(args[0], t)): if len(args) != 1 or not (args[0] is None or isinstance(args[0], t)):
return t(*args) return t(*args)
return args[0] return args[0]
def sizeof(arg): def sizeof(arg):
...@@ -187,7 +187,7 @@ def address(arg): ...@@ -187,7 +187,7 @@ def address(arg):
def _is_value_type(t): def _is_value_type(t):
if isinstance(t, typedef): if isinstance(t, typedef):
return _is_value_type(t._basetype) return _is_value_type(t._basetype)
return isinstance(t, type) and issubclass(t, (StructType, UnionType, ArrayType)) return isinstance(t, type) and issubclass(t, (StructType, UnionType, ArrayType))
def declare(t=None, value=_Unspecified, **kwds): def declare(t=None, value=_Unspecified, **kwds):
......
...@@ -57,6 +57,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { ...@@ -57,6 +57,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if PY_VERSION_HEX >= 0x03050000 #if PY_VERSION_HEX >= 0x03050000
{ {
// Make sure GC does not pick up our non-heap type as heap type with this hack! // Make sure GC does not pick up our non-heap type as heap type with this hack!
// For details, see https://github.com/cython/cython/issues/3603
PyObject *ret, *py_status; PyObject *ret, *py_status;
int gc_was_enabled; int gc_was_enabled;
PyObject *gc = PyImport_Import(PYUNICODE("gc")); PyObject *gc = PyImport_Import(PYUNICODE("gc"));
......
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