Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix ``SystemError`` raised when ``PyArg_Parse*()`` is used with ``#`` but
without ``PY_SSIZE_T_CLEAN`` defined.
6 changes: 3 additions & 3 deletions Python/getargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,9 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
/* For # codes */
#define REQUIRE_PY_SSIZE_T_CLEAN \
if (!(flags & FLAG_SIZE_T)) { \
PyErr_SetString(PyExc_SystemError, \
"PY_SSIZE_T_CLEAN macro must be defined for '#' formats"); \
return NULL; \
const char *msg = "PY_SSIZE_T_CLEAN macro must be defined for '#' formats"; \
PyErr_SetString(PyExc_SystemError, msg); \
return msg; \
}
#define RETURN_ERR_OCCURRED return msgbuf

Expand Down