From: Guido van Rossum Date: Tue, 8 May 2007 18:51:25 +0000 (+0000) Subject: Kill u"..." string quotes. Thought I already did that. X-Git-Tag: v3.0a1~995 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5e80b8c561de3a13154fa45eafcb32b8695eea7;p=python Kill u"..." string quotes. Thought I already did that. --- diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 3ea8ffb55f..58cb29ba87 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -220,7 +220,7 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(TypeError, compile, 'pass', '?', 'exec', mode='eval', source='0', filename='tmp') if have_unicode: - compile('print(u"\xe5")\n', '', 'exec') + compile('print("\xe5")\n', '', 'exec') self.assertRaises(TypeError, compile, chr(0), 'f', 'exec') self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad') @@ -340,7 +340,7 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(eval(str('c'), globals, locals), 300) ## bom = b'\xef\xbb\xbf' ## self.assertEqual(eval(bom + b'a', globals, locals), 1) - self.assertEqual(eval('u"\xe5"', globals), u"\xe5") + self.assertEqual(eval('"\xe5"', globals), "\xe5") self.assertRaises(TypeError, eval) self.assertRaises(TypeError, eval, ()) diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 563fbf2664..0428e0154e 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1227,14 +1227,6 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end) if (c == '"' || c == '\'') goto letter_quote; break; - case 'u': - case 'U': - c = tok_nextc(tok); - if (c == 'r' || c == 'R') - c = tok_nextc(tok); - if (c == '"' || c == '\'') - goto letter_quote; - break; case 'b': case 'B': c = tok_nextc(tok);