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
cf7ae767
Commit
cf7ae767
authored
Apr 01, 2011
by
Haoyu Bai
Committed by
Robert Bradshaw
Apr 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compatibility with python<=2.4
parent
599c3405
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+8
-2
No files found.
Cython/Compiler/Parsing.py
View file @
cf7ae767
...
...
@@ -1190,7 +1190,10 @@ def p_raise_statement(s):
def
p_import_statement
(
s
):
# will do absolute import in Py3 and try both relative and absolute in Py2.
level
=
0
if
s
.
context
.
language_level
>=
3
else
-
1
if
s
.
context
.
language_level
>=
3
:
level
=
0
else
:
level
=
-
1
# s.sy in ('import', 'cimport')
pos
=
s
.
position
()
kind
=
s
.
sy
...
...
@@ -1235,7 +1238,10 @@ def p_from_import_statement(s, first_statement = 0):
s
.
next
()
else
:
# will do absolute import in Py3 and try both relative and absolute in Py2.
level
=
0
if
s
.
context
.
language_level
>=
3
else
-
1
if
s
.
context
.
language_level
>=
3
:
level
=
0
else
:
level
=
-
1
if
level
>
0
and
s
.
sy
==
'cimport'
:
s
.
error
(
"Relative cimport is not supported yet"
)
...
...
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