Kaydet (Commit) 0b9201fa authored tarafından Stefan Krah's avatar Stefan Krah

Sub-issue of #9036: Fix incorrect use of Py_CHARMASK.

üst c7743aaa
......@@ -394,6 +394,7 @@ class UnicodeTest(
self.assertEqual(u'%c' % 0x1234, u'\u1234')
self.assertRaises(OverflowError, u"%c".__mod__, (sys.maxunicode+1,))
self.assertRaises(ValueError, u"%.1\u1032f".__mod__, (1.0/3))
for num in range(0x00,0x80):
char = chr(num)
......
......@@ -8417,7 +8417,7 @@ PyObject *PyUnicode_Format(PyObject *format,
else if (c >= '0' && c <= '9') {
prec = c - '0';
while (--fmtcnt >= 0) {
c = Py_CHARMASK(*fmt++);
c = *fmt++;
if (c < '0' || c > '9')
break;
if ((prec*10) / 10 != prec) {
......
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