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
1fed785b
Commit
1fed785b
authored
Jan 17, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some unnecessary Py2-isms in the code base
parent
b3fa3005
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
11 deletions
+11
-11
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+1
-1
Cython/Build/Inline.py
Cython/Build/Inline.py
+3
-3
Cython/Compiler/Errors.py
Cython/Compiler/Errors.py
+1
-1
Cython/Compiler/FlowControl.py
Cython/Compiler/FlowControl.py
+2
-2
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-2
Cython/Compiler/Pipeline.py
Cython/Compiler/Pipeline.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-1
No files found.
Cython/Build/Dependencies.py
View file @
1fed785b
...
...
@@ -678,7 +678,7 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo
options
[
'include_path'
]
=
[
'.'
]
if
'common_utility_include_dir'
in
options
:
if
options
.
get
(
'cache'
):
raise
NotImplementedError
,
"common_utility_include_dir does not yet work with caching"
raise
NotImplementedError
(
"common_utility_include_dir does not yet work with caching"
)
if
not
os
.
path
.
exists
(
options
[
'common_utility_include_dir'
]):
os
.
makedirs
(
options
[
'common_utility_include_dir'
])
c_options
=
CompilationOptions
(
**
options
)
...
...
Cython/Build/Inline.py
View file @
1fed785b
...
...
@@ -267,12 +267,12 @@ except ImportError:
for
name
,
value
in
kwd_values
.
items
():
if
name
in
args
:
if
name
in
all
:
raise
TypeError
,
"Duplicate argument %s"
%
name
raise
TypeError
(
"Duplicate argument %s"
%
name
)
all
[
name
]
=
kwd_values
.
pop
(
name
)
if
kwds
is
not
None
:
all
[
kwds
]
=
kwd_values
elif
kwd_values
:
raise
TypeError
,
"Unexpected keyword arguments: %s"
%
kwd_values
.
keys
(
)
raise
TypeError
(
"Unexpected keyword arguments: %s"
%
kwd_values
.
keys
()
)
if
defaults
is
None
:
defaults
=
()
first_default
=
len
(
args
)
-
len
(
defaults
)
...
...
@@ -281,7 +281,7 @@ except ImportError:
if
ix
>=
first_default
:
all
[
name
]
=
defaults
[
ix
-
first_default
]
else
:
raise
TypeError
,
"Missing argument: %s"
%
name
raise
TypeError
(
"Missing argument: %s"
%
name
)
return
all
def
get_body
(
source
):
...
...
Cython/Compiler/Errors.py
View file @
1fed785b
...
...
@@ -159,7 +159,7 @@ def report_error(err):
echo_file
.
write
(
line
.
encode
(
'ASCII'
,
'replace'
))
num_errors
=
num_errors
+
1
if
Options
.
fast_fail
:
raise
AbortError
,
"fatal errors"
raise
AbortError
(
"fatal errors"
)
def
error
(
position
,
message
):
#print "Errors.error:", repr(position), repr(message) ###
...
...
Cython/Compiler/FlowControl.py
View file @
1fed785b
...
...
@@ -798,7 +798,7 @@ class ControlFlowAnalysis(CythonTransform):
return
node
def
visit_AssignmentNode
(
self
,
node
):
raise
InternalError
,
"Unhandled assignment node"
raise
InternalError
(
"Unhandled assignment node"
)
def
visit_SingleAssignmentNode
(
self
,
node
):
self
.
_visit
(
node
.
rhs
)
...
...
@@ -1097,7 +1097,7 @@ class ControlFlowAnalysis(CythonTransform):
return
node
def
visit_LoopNode
(
self
,
node
):
raise
InternalError
,
"Generic loops are not supported"
raise
InternalError
(
"Generic loops are not supported"
)
def
visit_WithTargetAssignmentStatNode
(
self
,
node
):
self
.
mark_assignment
(
node
.
lhs
,
node
.
rhs
)
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
1fed785b
...
...
@@ -1970,7 +1970,7 @@ class ExpandInplaceOperators(EnvTransform):
return
node
,
[
node
]
elif
isinstance
(
node
,
ExprNodes
.
IndexNode
):
if
node
.
is_buffer_access
:
raise
ValueError
,
"Buffer access"
raise
ValueError
(
"Buffer access"
)
base
,
temps
=
side_effect_free_reference
(
node
.
base
)
index
=
LetRefNode
(
node
.
index
)
return
ExprNodes
.
IndexNode
(
node
.
pos
,
base
=
base
,
index
=
index
),
temps
+
[
index
]
...
...
@@ -2304,7 +2304,7 @@ class CreateClosureClasses(CythonTransform):
if
not
from_closure
and
(
self
.
path
or
inner_node
):
if
not
inner_node
:
if
not
node
.
py_cfunc_node
:
raise
InternalError
,
"DefNode does not have assignment node"
raise
InternalError
(
"DefNode does not have assignment node"
)
inner_node
=
node
.
py_cfunc_node
inner_node
.
needs_self_code
=
False
node
.
needs_outer_scope
=
False
...
...
Cython/Compiler/Pipeline.py
View file @
1fed785b
...
...
@@ -19,7 +19,7 @@ def dumptree(t):
def
abort_on_errors
(
node
):
# Stop the pipeline if there are any errors.
if
Errors
.
num_errors
!=
0
:
raise
AbortError
,
"pipeline break"
raise
AbortError
(
"pipeline break"
)
return
node
def
parse_stage_factory
(
context
):
...
...
Cython/Compiler/Symtab.py
View file @
1fed785b
...
...
@@ -1542,7 +1542,7 @@ class LocalScope(Scope):
if
entry
is
not
None
:
if
entry
.
scope
is
not
self
and
entry
.
scope
.
is_closure_scope
:
if
hasattr
(
entry
.
scope
,
"scope_class"
):
raise
InternalError
,
"lookup() after scope class created."
raise
InternalError
(
"lookup() after scope class created."
)
# The actual c fragment for the different scopes differs
# on the outside and inside, so we make a new entry
entry
.
in_closure
=
True
...
...
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