Commit ad6e2731 authored by Stefan Behnel's avatar Stefan Behnel

Re-add "c_api_binop_methods" directive for backwards compatibility after...

Re-add "c_api_binop_methods" directive for backwards compatibility after reverting https://github.com/cython/cython/pull/3633 and force it to "False".
Closes #3688.
parent 6933d867
......@@ -8,6 +8,9 @@ Cython Changelog
Bugs fixed
----------
* Fix a regression in 0.29.20 where ``__div__`` failed to be found in extension types.
(Github issue #3688)
* The deprecated C-API function ``PyUnicode_FromUnicode()`` is no longer used.
Original patch by Inada Naoki. (Github issue #3677)
......
......@@ -1223,6 +1223,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
type = entry.type
scope = type.scope
if scope: # could be None if there was an error
if not scope.directives['c_api_binop_methods']:
error(self.pos,
"The 'c_api_binop_methods' directive is only supported for forward compatibility"
" and must be True.")
self.generate_exttype_vtable(scope, code)
self.generate_new_function(scope, code, entry)
self.generate_dealloc_function(scope, code)
......
......@@ -178,6 +178,7 @@ _directive_defaults = {
'auto_pickle': None,
'cdivision': False, # was True before 0.12
'cdivision_warnings': False,
'c_api_binop_methods': True,
'overflowcheck': False,
'overflowcheck.fold': True,
'always_allow_keywords': False,
......
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