Skip to content

Commit 4c7db31

Browse files
author
Victor Stinner
committed
Issue #9738, #9836: Fix refleak introduced by r84704
1 parent dc08a14 commit 4c7db31

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_unicode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ def test_from_format(self):
13971397
# non-ascii format, ascii argument
13981398
self.assertRaisesRegexp(ValueError,
13991399
'^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format '
1400-
'string, got a non-ascii byte: 0xe9$',
1400+
'string, got a non-ASCII byte: 0xe9$',
14011401
format_unicode, b'unicode\xe9=%s', 'ascii')
14021402

14031403
def test_main():

Objects/unicodeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,9 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
767767
else if (128 <= (unsigned char)*f) {
768768
PyErr_Format(PyExc_ValueError,
769769
"PyUnicode_FromFormatV() expects an ASCII-encoded format "
770-
"string, got a non-ascii byte: 0x%02x",
770+
"string, got a non-ASCII byte: 0x%02x",
771771
(unsigned char)*f);
772-
return NULL;
772+
goto fail;
773773
}
774774
}
775775
/* step 2: allocate memory for the results of

0 commit comments

Comments
 (0)