summaryrefslogtreecommitdiff
path: root/tests/run/refcount_in_meth.pyx
diff options
context:
space:
mode:
authorscoder <stefan_ml@behnel.de>2020-05-24 20:45:04 +0200
committerGitHub <noreply@github.com>2020-05-24 20:45:04 +0200
commitf293ef4baf86e396983deb4418d4d56f711cfd0f (patch)
tree0cab20aa668f22b57fcbdea1d88f5937506cab96 /tests/run/refcount_in_meth.pyx
parent445f055ca9748e0b716aaab900a5244e980aab67 (diff)
downloadcython-f293ef4baf86e396983deb4418d4d56f711cfd0f.tar.gz
Change default of "always_allow_keywords" directive to True (GH-3605)
This avoids the METH_O function signature by default, since it does not match normal Python semantics. * Fix unicode name handling of no-args functions when allowing keywords. * Fix a crash when a keyword argument is passed to a function that does not allow them. Previously, the reported key name was not set and thus NULL. * Extend "always_allow_keywords" test to cover some edge cases. Some are commented out as they currently only work with the fastcall implementation.
Diffstat (limited to 'tests/run/refcount_in_meth.pyx')
-rw-r--r--tests/run/refcount_in_meth.pyx2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/run/refcount_in_meth.pyx b/tests/run/refcount_in_meth.pyx
index ed21b437b..af6212779 100644
--- a/tests/run/refcount_in_meth.pyx
+++ b/tests/run/refcount_in_meth.pyx
@@ -12,8 +12,10 @@ True
True
"""
+cimport cython
from cpython.ref cimport PyObject
+@cython.always_allow_keywords(False)
def get_refcount(obj):
return (<PyObject*>obj).ob_refcnt