Commit 4c7db315 authored by Victor Stinner's avatar Victor Stinner

Issue #9738, #9836: Fix refleak introduced by r84704

parent dc08a143
...@@ -1397,7 +1397,7 @@ class UnicodeTest(string_tests.CommonTest, ...@@ -1397,7 +1397,7 @@ class UnicodeTest(string_tests.CommonTest,
# non-ascii format, ascii argument # non-ascii format, ascii argument
self.assertRaisesRegexp(ValueError, self.assertRaisesRegexp(ValueError,
'^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format ' '^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format '
'string, got a non-ascii byte: 0xe9$', 'string, got a non-ASCII byte: 0xe9$',
format_unicode, b'unicode\xe9=%s', 'ascii') format_unicode, b'unicode\xe9=%s', 'ascii')
def test_main(): def test_main():
......
...@@ -767,9 +767,9 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) ...@@ -767,9 +767,9 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
else if (128 <= (unsigned char)*f) { else if (128 <= (unsigned char)*f) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"PyUnicode_FromFormatV() expects an ASCII-encoded format " "PyUnicode_FromFormatV() expects an ASCII-encoded format "
"string, got a non-ascii byte: 0x%02x", "string, got a non-ASCII byte: 0x%02x",
(unsigned char)*f); (unsigned char)*f);
return NULL; goto fail;
} }
} }
/* step 2: allocate memory for the results of /* step 2: allocate memory for the results of
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment