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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
4d5c1c4e
Commit
4d5c1c4e
authored
Nov 03, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid useless lookup of unknown encoding (fixes compiler crash)
parent
2e3d8413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+2
-2
No files found.
Cython/Compiler/Optimize.py
View file @
4d5c1c4e
...
...
@@ -2709,7 +2709,7 @@ class OptimizeBuiltinCalls(Visitor.MethodDispatcherTransform):
return
node
encoding
,
encoding_node
,
error_handling
,
error_handling_node
=
parameters
if
isinstance
(
string_node
,
ExprNodes
.
UnicodeNode
):
if
encoding
and
isinstance
(
string_node
,
ExprNodes
.
UnicodeNode
):
# constant, so try to do the encoding at compile time
try
:
value
=
string_node
.
value
.
encode
(
encoding
,
error_handling
)
...
...
@@ -2722,7 +2722,7 @@ class OptimizeBuiltinCalls(Visitor.MethodDispatcherTransform):
return
ExprNodes
.
BytesNode
(
string_node
.
pos
,
value
=
value
,
type
=
Builtin
.
bytes_type
)
if
error_handling
==
'strict'
:
if
e
ncoding
and
e
rror_handling
==
'strict'
:
# try to find a specific encoder function
codec_name
=
self
.
_find_special_codec_name
(
encoding
)
if
codec_name
is
not
None
:
...
...
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