| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Replace soft deprecated PyBytes_FromStringAndSize() with PyBytesWriter. Use PyBytesWriter_Create() for the float code path, or PyMem_Malloc() for the int code path.
| } | ||
| else { | ||
| writer = NULL; | ||
| buf = PyMem_Malloc(n + 1); |
There was a problem hiding this comment.
PyLong_FromString() doesn't need a bytes object, just a C string (char*). But maybe the PyLong code path should also use PyBytesWriter to simplify the code.
Sorry, something went wrong.
|
The alternative to creating a temporary bytes object is... to not create a Python object at all :-) I wrote PR gh-156897 for that. |
Sorry, something went wrong.
|
I close this PR since PR #156897 seems to be a better approach. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Replace soft deprecated PyBytes_FromStringAndSize() with PyBytesWriter.
Use PyBytesWriter_Create() for the float code path, or PyMem_Malloc() for the int code path.