From 4c7db315df75bdd014041b12122a34cf9f034754 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 12 Sep 2010 07:51:18 +0000 Subject: Issue #9738, #9836: Fix refleak introduced by r84704 --- Lib/test/test_unicode.py | 2 +- Objects/unicodeobject.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 0c23daa..aeac724 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1397,7 +1397,7 @@ class UnicodeTest(string_tests.CommonTest, # non-ascii format, ascii argument self.assertRaisesRegexp(ValueError, '^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') def test_main(): diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3b0a66a..92df1ce 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -767,9 +767,9 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) else if (128 <= (unsigned char)*f) { PyErr_Format(PyExc_ValueError, "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); - return NULL; + goto fail; } } /* step 2: allocate memory for the results of -- cgit v0.12