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
Gwenaël Samain
cython
Commits
34d7b597
Commit
34d7b597
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
dee6b6dd
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 @
34d7b597
...
@@ -1190,7 +1190,10 @@ def p_raise_statement(s):
...
@@ -1190,7 +1190,10 @@ def p_raise_statement(s):
def
p_import_statement
(
s
):
def
p_import_statement
(
s
):
# will do absolute import in Py3 and try both relative and absolute in Py2.
# 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')
# s.sy in ('import', 'cimport')
pos
=
s
.
position
()
pos
=
s
.
position
()
kind
=
s
.
sy
kind
=
s
.
sy
...
@@ -1235,7 +1238,10 @@ def p_from_import_statement(s, first_statement = 0):
...
@@ -1235,7 +1238,10 @@ def p_from_import_statement(s, first_statement = 0):
s
.
next
()
s
.
next
()
else
:
else
:
# will do absolute import in Py3 and try both relative and absolute in Py2.
# 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'
:
if
level
>
0
and
s
.
sy
==
'cimport'
:
s
.
error
(
"Relative cimport is not supported yet"
)
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