Merged revisions 82828 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82828 | benjamin.peterson | 2010-07-11 18:06:06 -0500 (Sun, 11 Jul 2010) | 1 line

  allow byte literals
........
diff --git a/Lib/ast.py b/Lib/ast.py
index 0b8baf7..027302f 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -50,7 +50,7 @@
     if isinstance(node_or_string, Expression):
         node_or_string = node_or_string.body
     def _convert(node):
-        if isinstance(node, Str):
+        if isinstance(node, (Str, Bytes)):
             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 7ee16bf..e188887 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -271,6 +271,7 @@
         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):
diff --git a/Misc/NEWS b/Misc/NEWS
index 601943f..7c26473 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -78,6 +78,8 @@
 Library
 -------
 
+- ``ast.literal_eval()`` now allows byte literals.
+
 - Issue #9137: Fix issue in MutableMapping.update, which incorrectly
   treated keyword arguments called 'self' or 'other' specially.