summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-07-18 14:36:12 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-07-18 14:36:12 (GMT)
commit22dcfccee5adb56bf3f2c90dc1ad61cd28251e10 (patch)
tree96d9ed1ea5f1cb92d67b4353a03a315e129d18a8 /Lib
parent7a502de6f809f1ecb110bd84ffda94dd852f53ed (diff)
downloadcpython-22dcfccee5adb56bf3f2c90dc1ad61cd28251e10.zip
cpython-22dcfccee5adb56bf3f2c90dc1ad61cd28251e10.tar.gz
cpython-22dcfccee5adb56bf3f2c90dc1ad61cd28251e10.tar.bz2
remove support for byte literals; a new feature
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ast.py2
-rw-r--r--Lib/test/test_ast.py1
2 files changed, 1 insertions, 2 deletions
diff --git a/Lib/ast.py b/Lib/ast.py
index 027302f..0b8baf7 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -50,7 +50,7 @@ def literal_eval(node_or_string):
if isinstance(node_or_string, Expression):
node_or_string = node_or_string.body
def _convert(node):
- if isinstance(node, (Str, Bytes)):
+ if isinstance(node, Str):
return node.s
elif isinstance(node, Num):
return node.n
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index e188887..7ee16bf 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -271,7 +271,6 @@ class ASTHelpers_Test(unittest.TestCase):
self.assertEqual(ast.literal_eval('[1, 2, 3]'), [1, 2, 3])
self.assertEqual(ast.literal_eval('{"foo": 42}'), {"foo": 42})
self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None))
- self.assertEqual(ast.literal_eval('b"hi"'), b"hi")
self.assertRaises(ValueError, ast.literal_eval, 'foo()')
def test_literal_eval_issue4907(self):