Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
7f882783
Commit
7f882783
authored
Feb 11, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repair crash when parsing Py3 byte strings
parent
2113719e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-2
No files found.
Cython/Compiler/Parsing.py
View file @
7f882783
...
@@ -939,10 +939,10 @@ def p_string_literal(s, kind_override=None):
...
@@ -939,10 +939,10 @@ def p_string_literal(s, kind_override=None):
error
(
pos
,
u"invalid character literal: %r"
%
bytes_value
)
error
(
pos
,
u"invalid character literal: %r"
%
bytes_value
)
else
:
else
:
bytes_value
,
unicode_value
=
chars
.
getstrings
()
bytes_value
,
unicode_value
=
chars
.
getstrings
()
if
is_python3_source
and
check_for_non_ascii_characters
(
unicode_value
):
if
is_python3_source
and
unicode_value
and
check_for_non_ascii_characters
(
unicode_value
):
# Python 3 forbids literal non-ASCII characters in byte strings
# Python 3 forbids literal non-ASCII characters in byte strings
if
kind
not
in
(
'u'
,
'f'
):
if
kind
not
in
(
'u'
,
'f'
):
error
(
pos
,
"bytes can only contain ASCII literal characters."
)
s
.
error
(
"bytes can only contain ASCII literal characters."
,
pos
=
pos
)
bytes_value
=
None
bytes_value
=
None
if
kind
==
'f'
:
if
kind
==
'f'
:
unicode_value
=
p_f_string
(
s
,
unicode_value
,
pos
,
is_raw
=
'r'
in
kind_string
)
unicode_value
=
p_f_string
(
s
,
unicode_value
,
pos
,
is_raw
=
'r'
in
kind_string
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment