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
719a49e2
Commit
719a49e2
authored
Mar 22, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include pyximport in testrunner for py3k and fix py3k unicode fused bug
parent
f69d1c2a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
7 deletions
+15
-7
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+7
-3
Cython/Compiler/FusedNode.py
Cython/Compiler/FusedNode.py
+3
-2
Cython/Compiler/Importer.py
Cython/Compiler/Importer.py
+1
-1
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-1
runtests.py
runtests.py
+2
-0
No files found.
Cython/Compiler/Code.py
View file @
719a49e2
...
...
@@ -1948,11 +1948,11 @@ class PyxCodeWriter(object):
to load the code to support python 2.4
"""
def
__init__
(
self
,
buffer
=
None
,
indent_level
=
0
,
context
=
None
):
def
__init__
(
self
,
buffer
=
None
,
indent_level
=
0
,
context
=
None
,
encoding
=
'ascii'
):
self
.
buffer
=
buffer
or
StringIOTree
()
self
.
level
=
indent_level
self
.
context
=
context
self
.
encoding
=
'ascii'
self
.
encoding
=
encoding
def
indent
(
self
,
levels
=
1
):
self
.
level
+=
levels
...
...
@@ -1969,7 +1969,11 @@ class PyxCodeWriter(object):
return
self
def
getvalue
(
self
):
return
unicode
(
self
.
buffer
.
getvalue
(),
self
.
encoding
)
result
=
self
.
buffer
.
getvalue
()
if
not
isinstance
(
result
,
unicode
):
result
=
result
.
decode
(
self
.
encoding
)
return
result
def
putln
(
self
,
line
,
context
=
None
):
context
=
context
or
self
.
context
...
...
Cython/Compiler/FusedNode.py
View file @
719a49e2
from
__future__
import
with_statement
import
copy
from
Cython.Compiler
import
(
ExprNodes
,
PyrexTypes
,
MemoryView
,
...
...
@@ -605,8 +607,7 @@ class FusedCFuncDefNode(StatListNode):
fragment_code
=
pyx_code
.
getvalue
()
# print decl_code.getvalue()
# print fragment_code
fragment
=
TreeFragment
.
TreeFragment
(
fragment_code
.
decode
(
'ascii'
),
level
=
'module'
)
fragment
=
TreeFragment
.
TreeFragment
(
fragment_code
,
level
=
'module'
)
ast
=
TreeFragment
.
SetPosTransform
(
self
.
node
.
pos
)(
fragment
.
root
)
UtilityCode
.
declare_declarations_in_scope
(
decl_code
.
getvalue
(),
env
)
ast
.
scope
=
env
...
...
Cython/Compiler/Importer.py
View file @
719a49e2
...
...
@@ -40,7 +40,7 @@ def importer(modulename, compile=False, version=None):
Otherwise, try a regular import and if that fails (i.e. there is a
syntax error, try to compile it.
"""
if
version
is
not
None
and
sys
.
version_info
[:
2
]
>=
version
:
if
version
is
not
None
and
sys
.
version_info
[:
2
]
>=
version
and
not
compile
:
return
_import_normal
(
modulename
)
if
compile
:
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
719a49e2
...
...
@@ -1489,7 +1489,8 @@ if VALUE is not None:
return
node
FusedNode
=
Importer
.
importer
(
"Cython.Compiler.FusedNode"
,
version
=
(
2
,
5
))
FusedNode
=
Importer
.
importer
(
"Cython.Compiler.FusedNode"
,
version
=
(
2
,
5
))
node
=
FusedNode
.
FusedCFuncDefNode
(
node
,
env
)
self
.
fused_function
=
node
...
...
runtests.py
View file @
719a49e2
...
...
@@ -1251,6 +1251,8 @@ def refactor_for_py3(distdir, cy3_dir):
recursive-include Cython *.py *.pyx *.pxd
recursive-include Cython/Debugger/Tests *
recursive-include Cython/Utility *
recursive-exclude pyximport test
include pyximport/*.py
include runtests.py
include cython.py
''')
...
...
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