| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
completely excluded via preprocessor guards.
Previously, implementing "__div__" could fail in Py3 (if the code for adapting the Python wrapper was generated) or would at least generate C compiler warnings about unused "__div__" C functions.
|
| |
|
| |
|
|
|
|
| |
Fix insert return types, constness and input iterator templates.
Fix typing in iterators and add constructor to allow explicit conversion from iterator to const_iterator.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
having to maintain our own ones.
|
| |
| |
| |
| | |
* add swap() to libcpp.string
* add load_factor() to libcpp.unordered_map and libcpp.unordered_set
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| | |
PyPy v7.3.6 looks to have added a helpful "did you mean..." to the AttributeError exception. It's currently tripping up these tests.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
Instead of __Pyx_SetTracing(), Profile.c now uses PyThreadState_EnterTracing() and PyThreadState_LeaveTracing(), which were added to Python 3.11.0a2:
https://github.com/python/cpython/pull/28542
When these functions are used, Cython no longer sets directly PyThreadState.cframe.use_tracing.
|
| |
| |
| |
| |
| |
| | |
A couple of things were going wrong:
* they're creating CloneNodes (but not requiring the contents of the clone of the clone node to be temp)
* assignment from a clone node generates cleanup code (which is against the general rules of a clone node), and also loses a reference via giveref
* cpdef functions cause a small memory leak (#4412) by assigning to their constants twice. This is unfortunately difficult to test for. With this patch we no longer leak, but still duplicate a little bit of work.
|
| |
| |
| | |
All the versions we currently test are new enough that the alias is no longer necessary.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Stop using NPY_NDARRAYOBJECT_H since:
a) in principle it's private
b) Numpy has renamed it
and use a public symbol instead.
I think the existing tests are adequate - we just aren't yet testing
against a new enough version of Numpy to have caught it yet.
Closes https://github.com/cython/cython/issues/4396
Closes https://github.com/cython/cython/issues/4394
|
| | |
|
| |
| |
| |
| |
| |
| | |
A few children of function nodes need to be consistently evaluated
outside the function scope. This PR attempts to do so and thus
fixes https://github.com/cython/cython/issues/4367.
|
| |
| |
| |
| | |
The string comparison was reporting '11' < '4' (so OpenMP tests were being skipped on GCC 11)
|
| | |
|
| |
| |
| |
| |
| | |
Attribute names used to be fully qualified like "_cython_3_0_0a9.cython_function_or_method" instead of the plain name.
Closes https://github.com/cython/cython/issues/4373
|
| |
| |
| |
| |
| |
| |
| | |
This can happen (rarely) with exceptions that occur very early in the module init process.
Fixes https://github.com/cython/cython/issues/4377
Uses a fake Numpy module for testing to make a version of "import_array" that always fails.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is explicitly tested for: https://github.com/cython/cython/blob/aea4e6b84b38223c540266f8c57093ee2039f284/tests/run/test_coroutines_pep492.pyx#L2400
It turns out some earlier versions of Python assume that
C-API classes without a dict or slot are pickleable by the class
name. Currently it isn't pickleable because the class name lookup
is failing but this change makes it more robust.
See https://github.com/cython/cython/pull/4376
|
| |
| |
| | |
Among other things this makes it pickleable by ensuring that it's the same object each time.
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| | |
"PyUnicode_CompareWithASCIIString()" does not raise exceptions and takes a "const char*" as argument.
|
| |
| |
| |
| | |
This was causing c++ classes in if-statements to crash.
Fixes #4348
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ff16389c0da5acc2be1 introduced convenient functions get_value() and get_value_no_default().
Unfortunately, the variable `value` in these functions was not set before usage with PyContextVar_Get().
This triggered some warnings:
Error compiling Cython file:
------------------------------------------------------------
...
"""Return a new reference to the value of the context variable,
or the default value of the context variable,
or None if no such value or default was found.
"""
cdef PyObject *value
PyContextVar_Get(var, NULL, &value)
^
------------------------------------------------------------
Cython/Includes/cpython/contextvars.pxd:118:33: local variable 'value' might be referenced before assignment
Error compiling Cython file:
------------------------------------------------------------
...
or the provided default value if no such value was found.
Ignores the default value of the context variable, if any.
"""
cdef PyObject *value
PyContextVar_Get(var, <PyObject*>default_value, &value)
^
------------------------------------------------------------
Cython/Includes/cpython/contextvars.pxd:136:53: local variable 'value' might be referenced before assignment
It can be replicated by simply importing `cpython`:
echo "cimport cpython" >/tmp/mod.pyx && ./cython.py -Werror -Wextra /tmp/mod.pyx
The solution is simply to assign NULL to `value` on declaration.
|
| |
| |
| |
| |
| | |
See
https://github.com/cython/cython/pull/4349
https://github.com/cython/cython/commit/0574dbceef7b8ee16a9cc94091c3629dfa23133d#r54025763
|
| |
| |
| |
| | |
This was causing c++ classes in if-statements to crash.
Fixes #4348
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
be aligned. Use memcpy() instead to let the C compiler decide how to do it.
Closes https://github.com/cython/cython/issues/4343
|
| |
| |
| |
| |
| |
| | |
be aligned. Use memcpy() instead to let the C compiler decide how to do it.
Closes https://github.com/cython/cython/issues/4343
|
| |
| |
| |
| |
| |
| |
| | |
See https://github.com/cython/cython/pull/4142#issuecomment-831464115
I don't think MinGW has worked since around Python 3.4 (but I'm
not completely confident in that) while I know that MSVC does
work. Therefore we should recommend that.
|
| |
| |
| | |
Compiling ExprNodes.py was creating hundreds of tuples containing ("self", "env") for example, because it wasn't able to match and deduplicate them.
|
| |
| |
| | |
"PyUnicode_CompareWithASCIIString()" does not raise exceptions and takes a "const char*" as argument.
|
| |
| |
| |
| |
| |
| |
| | |
* Avoid usage of `const` or `volatile` in buffer struct field declarations.
* Avoid newline replacement in the test helper functions `write_file()` and `write_newer_file()`.
See https://github.com/cython/cython/pull/4324
|
| | |
|
| |
| |
| |
| | |
(GH-4316)
|
| |
| |
| |
| |
| | |
These were lost when cdef properties (for extern types) were introduced.
Closes #4322 (based on my interpretation of the problem as an error-reporting issue)
|
| |
| |
| | |
Adds utility code sections to toggle C compiler warnings for the duration of the utility code.
|
| | |
|