Open hroncok opened 2 months ago
Please do not use
#if PY_VERSION_HEX < 0x030d0000
.
.
#else
.
.
#endif
Because this makes that code not pyupgradeable. Please use
if sys.version_info < (3, 13):
.
.
else:
.
.
This would allow in the future drop first part of the code on use pyupgrade --py313
.
Or if you want to use that please first submit to pyupgrade PR which would allow recognise code like in your PR.
Tomasz, this is C. Feel free to submit an alternate PR, but I won't try to figure out how to make changes in C pyupgradeable.
Avoid using PyObject_AsReadBuffer, do what PyObject_AsReadBuffer does.
Note that this is not safe, and it has never been safe, but the code does exactly what it used to do (at least on Python 3.8+).
Fixes https://github.com/jnwatson/py-lmdb/issues/362