Skip to content

Commit 72ae3d0

Browse files
committed
Use PyUnicodeWriter_WriteRepr
1 parent 51c760f commit 72ae3d0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Modules/_json.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "Python.h"
1212
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
1313
#include "pycore_global_strings.h" // _Py_ID()
14-
#include "pycore_long.h" // _PyLong_FormatWriter()
1514
#include "pycore_pyerrors.h" // _PyErr_FormatNote
1615
#include "pycore_runtime.h" // _PyRuntime
1716
#include "pycore_unicodeobject.h" // _PyUnicode_CheckConsistency()
@@ -1485,7 +1484,7 @@ encoder_listencode_obj(PyEncoderObject *s, _PyUnicodeWriter *writer,
14851484
else if (PyLong_Check(obj)) {
14861485
if (PyLong_CheckExact(obj)) {
14871486
// Fast-path for exact integers
1488-
return _PyLong_FormatWriter(writer, obj, 10, 0);
1487+
return PyUnicodeWriter_WriteRepr((PyUnicodeWriter*)writer, obj);
14891488
}
14901489
PyObject *encoded = PyLong_Type.tp_repr(obj);
14911490
if (encoded == NULL)

0 commit comments

Comments
 (0)