From 851c4e94a75452f13e333dab3cfdf7a9401e81aa Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 5 Jun 2024 12:26:16 -0400 Subject: [PATCH] Replace `_PyLong_Format` with `PyNumber_ToBase` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_PyLong_Format` is in Python’s internal, private API; `PyNumber_ToBase` belongs to the Stable API, and is a fairly thin wrapper around `_PyLong_Format` with a bit of extra error checking. Fixes #116. --- immutables/_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/immutables/_map.c b/immutables/_map.c index d3990aed..256f4677 100644 --- a/immutables/_map.c +++ b/immutables/_map.c @@ -1284,7 +1284,7 @@ map_node_bitmap_dump(MapNode_Bitmap *node, if (tmp1 == NULL) { goto error; } - tmp2 = _PyLong_Format(tmp1, 2); + tmp2 = PyNumber_ToBase(tmp1, 2); Py_DECREF(tmp1); if (tmp2 == NULL) { goto error;