diff options
author | Jason Madden <jamadden@gmail.com> | 2020-01-20 08:23:51 -0600 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2020-01-20 08:26:02 -0600 |
commit | 5658bd31dacda687512cbe58740cd18c7e074c0f (patch) | |
tree | 5444ebbd6e97c8a2e5a82a167bd66ec7a0f4d022 /src/zope | |
parent | 9d8b17c40bd68e329b6fc8a52c41d52d247c90dc (diff) | |
download | zope-proxy-5658bd31dacda687512cbe58740cd18c7e074c0f.tar.gz |
Don't set tp_print/tp_vectorcall_offset on Python 3.issue36
In 3.8 it produces a compilation warning, in earlier versions it is ignored.
Normalize ReST headings when adding the change note.
Publish changes on RTD.
Diffstat (limited to 'src/zope')
-rw-r--r-- | src/zope/proxy/_zope_proxy_proxy.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zope/proxy/_zope_proxy_proxy.c b/src/zope/proxy/_zope_proxy_proxy.c index 572db97..f846acc 100644 --- a/src/zope/proxy/_zope_proxy_proxy.c +++ b/src/zope/proxy/_zope_proxy_proxy.c @@ -340,11 +340,14 @@ finally: return res; } +#if PY_MAJOR_VERSION < 3 +// tp_print slot function; reserved and unused in Python 3 static int wrap_print(PyObject *wrapper, FILE *fp, int flags) { return PyObject_Print(Proxy_GET_OBJECT(wrapper), fp, flags); } +#endif static PyObject * wrap_str(PyObject *wrapper) { @@ -865,7 +868,11 @@ ProxyType = { sizeof(ProxyObject), 0, wrap_dealloc, /* tp_dealloc */ +#if PY_MAJOR_VERSION < 3 wrap_print, /* tp_print */ +#else + 0, /* reserved 3.0--3.7; tp_vectorcall_offset 3.8+ */ +#endif 0, /* tp_getattr */ 0, /* tp_setattr */ #if PY_MAJOR_VERSION < 3 |