except SystemError as e:
s = "argument 1 (impossible<bad format char>)"
when_not_skipped = (str(e) == s)
- except (TypeError, RuntimeError):
+ except TypeError:
when_not_skipped = False
# test the format unit when skipped
_testcapi.parse_tuple_and_keywords(empty_tuple, dict_b,
optional_format.encode("ascii"), keywords)
when_skipped = False
- except RuntimeError as e:
+ except SystemError as e:
s = "impossible<bad format char>: '{}'".format(format)
when_skipped = (str(e) == s)
keyword = kwlist[i];
if (*format == '|') {
if (min != INT_MAX) {
- PyErr_SetString(PyExc_RuntimeError,
+ PyErr_SetString(PyExc_SystemError,
"Invalid format string (| specified twice)");
return cleanreturn(0, &freelist);
}
format++;
if (max != INT_MAX) {
- PyErr_SetString(PyExc_RuntimeError,
+ PyErr_SetString(PyExc_SystemError,
"Invalid format string ($ before |)");
return cleanreturn(0, &freelist);
}
}
if (*format == '$') {
if (max != INT_MAX) {
- PyErr_SetString(PyExc_RuntimeError,
+ PyErr_SetString(PyExc_SystemError,
"Invalid format string ($ specified twice)");
return cleanreturn(0, &freelist);
}
}
}
if (IS_END_OF_FORMAT(*format)) {
- PyErr_Format(PyExc_RuntimeError,
+ PyErr_Format(PyExc_SystemError,
"More keyword list entries (%d) than "
"format specifiers (%d)", len, i);
return cleanreturn(0, &freelist);
* keyword args */
msg = skipitem(&format, p_va, flags);
if (msg) {
- PyErr_Format(PyExc_RuntimeError, "%s: '%s'", msg,
+ PyErr_Format(PyExc_SystemError, "%s: '%s'", msg,
format);
return cleanreturn(0, &freelist);
}
}
if (!IS_END_OF_FORMAT(*format) && (*format != '|') && (*format != '$')) {
- PyErr_Format(PyExc_RuntimeError,
+ PyErr_Format(PyExc_SystemError,
"more argument specifiers than keyword list entries "
"(remaining format:'%s')", format);
return cleanreturn(0, &freelist);