mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
allow byte literals
This commit is contained in:
parent
c762242cca
commit
5ef96e5fac
3 changed files with 4 additions and 1 deletions
|
@ -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):
|
||||
if isinstance(node, (Str, Bytes)):
|
||||
return node.s
|
||||
elif isinstance(node, Num):
|
||||
return node.n
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue