Commit b7f85160 authored by Benjamin Peterson's avatar Benjamin Peterson

#2541 Allow unicode escapes in raw strings

parent 53a32956
......@@ -68,6 +68,8 @@ class UnicodeTest(
self.assertRaises(SyntaxError, eval, '\'\\Ufffffffe\'')
self.assertRaises(SyntaxError, eval, '\'\\Uffffffff\'')
self.assertRaises(SyntaxError, eval, '\'\\U%08x\'' % 0x110000)
# Test that raw mode does unicode escapes
self.assertEqual(r"\u0020", " ")
def test_repr(self):
if not sys.platform.startswith('java'):
......
......@@ -3231,7 +3231,7 @@ parsestr(struct compiling *c, const node *n, int *bytesmode)
return NULL;
}
}
if (!*bytesmode && !rawmode) {
if (!*bytesmode) {
return decode_unicode(s, len, rawmode, c->c_encoding);
}
if (*bytesmode) {
......
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