Commit 34eac74e authored by Stefan Behnel's avatar Stefan Behnel

Merge branch 'release'

parents a29411ee 3eb9e2b1
...@@ -31,7 +31,7 @@ Other changes ...@@ -31,7 +31,7 @@ Other changes
* Support for Python 2.6 was removed. * Support for Python 2.6 was removed.
0.29.1 (2018-1?-??) 0.29.1 (2018-11-24)
=================== ===================
Bugs fixed Bugs fixed
......
...@@ -935,11 +935,13 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { ...@@ -935,11 +935,13 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
return 0; return 0;
} }
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
PyObject *value = PyObject_GetAttrString(spec, from_name); PyObject *value = PyObject_GetAttrString(spec, from_name);
int result = 0; int result = 0;
if (likely(value)) { if (likely(value)) {
result = PyDict_SetItemString(moddict, to_name, value); if (allow_none || value != Py_None) {
result = PyDict_SetItemString(moddict, to_name, value);
}
Py_DECREF(value); Py_DECREF(value);
} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Clear(); PyErr_Clear();
...@@ -969,10 +971,10 @@ static CYTHON_SMALL_CODE PyObject* ${pymodule_create_func_cname}(PyObject *spec, ...@@ -969,10 +971,10 @@ static CYTHON_SMALL_CODE PyObject* ${pymodule_create_func_cname}(PyObject *spec,
if (unlikely(!moddict)) goto bad; if (unlikely(!moddict)) goto bad;
// moddict is a borrowed reference // moddict is a borrowed reference
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
return module; return module;
bad: bad:
......
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