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
2fd9231a
Commit
2fd9231a
authored
Oct 26, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup, support unbound method calls to bytes.decode()
parent
1f8ffaa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
14 deletions
+0
-14
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+0
-14
No files found.
Cython/Compiler/Optimize.py
View file @
2fd9231a
...
...
@@ -1033,8 +1033,6 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
if
len
(
args
)
<
1
or
len
(
args
)
>
3
:
self
.
_error_wrong_arg_count
(
'bytes.decode'
,
node
,
args
,
'1-3'
)
return
node
if
is_unbound_method
:
return
node
if
not
isinstance
(
args
[
0
],
ExprNodes
.
SliceIndexNode
):
# we need the string length as a slice end index
return
node
...
...
@@ -1069,12 +1067,6 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
is_temp
=
node
.
is_temp
,
)
return
self
.
_substitute_method_call
(
node
,
decode_function
,
self
.
PyUnicode_DecodeXyz_func_type
,
'decode'
,
is_unbound_method
,
[
string_node
,
stop
,
error_handling_node
])
return
ExprNodes
.
PythonCapiCallNode
(
node
.
pos
,
"PyUnicode_Decode"
,
self
.
PyUnicode_Decode_func_type
,
...
...
@@ -1082,12 +1074,6 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
is_temp
=
node
.
is_temp
,
)
return
self
.
_substitute_method_call
(
node
,
"PyUnicode_Decode"
,
self
.
PyUnicode_Decode_func_type
,
'decode'
,
is_unbound_method
,
[
string_node
,
stop
,
encoding_node
,
error_handling_node
])
def
_find_special_codec_name
(
self
,
encoding
):
try
:
requested_codec
=
codecs
.
getencoder
(
encoding
)
...
...
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