8000 Simplify trivial calls of PyUnicode_FromFormat() (GH-111605) · python/cpython@5d6db16 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d6db16

Browse files
Simplify trivial calls of PyUnicode_FromFormat() (GH-111605)
1 parent d9b606b commit 5d6db16

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Modules/_xxsubinterpretersmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ _sharedexception_bind(PyObject *exc, int code, _sharedexception *sharedexc)
307307
}
308308

309309
if (exc != NULL) {
310-
PyObject *msgobj = PyUnicode_FromFormat("%S", exc);
310+
PyObject *msgobj = PyObject_Str(exc);
311311
if (msgobj == NULL) {
312312
failure = "unable to format exception message";
313313
code = ERR_NO_MEMORY;

Modules/_zoneinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ zoneinfo_ZoneInfo_from_file_impl(PyTypeObject *type, PyTypeObject *cls,
420420
return NULL;
421421
}
422422

423-
file_repr = PyUnicode_FromFormat("%R", file_obj);
423+
file_repr = PyObject_Repr(file_obj);
424424
if (file_repr == NULL) {
425425
goto error;
426426
}

0 commit comments

Comments
 (0)
0