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
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):
...
@@ -1948,11 +1948,11 @@ class PyxCodeWriter(object):
to load the code to support python 2.4
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
.
buffer
=
buffer
or
StringIOTree
()
self
.
level
=
indent_level
self
.
level
=
indent_level
self
.
context
=
context
self
.
context
=
context
self
.
encoding
=
'ascii'
self
.
encoding
=
encoding
def
indent
(
self
,
levels
=
1
):
def
indent
(
self
,
levels
=
1
):
self
.
level
+=
levels
self
.
level
+=
levels
...
@@ -1969,7 +1969,11 @@ class PyxCodeWriter(object):
...
@@ -1969,7 +1969,11 @@ class PyxCodeWriter(object):
return
self
return
self
def
getvalue
(
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
):
def
putln
(
self
,
line
,
context
=
None
):
context
=
context
or
self
.
context
context
=
context
or
self
.
context
...
...
Cython/Compiler/FusedNode.py
View file @
719a49e2
from
__future__
import
with_statement
import
copy
import
copy
from
Cython.Compiler
import
(
ExprNodes
,
PyrexTypes
,
MemoryView
,
from
Cython.Compiler
import
(
ExprNodes
,
PyrexTypes
,
MemoryView
,
...
@@ -605,8 +607,7 @@ class FusedCFuncDefNode(StatListNode):
...
@@ -605,8 +607,7 @@ class FusedCFuncDefNode(StatListNode):
fragment_code
=
pyx_code
.
getvalue
()
fragment_code
=
pyx_code
.
getvalue
()
# print decl_code.getvalue()
# print decl_code.getvalue()
# print fragment_code
# print fragment_code
fragment
=
TreeFragment
.
TreeFragment
(
fragment_code
.
decode
(
'ascii'
),
fragment
=
TreeFragment
.
TreeFragment
(
fragment_code
,
level
=
'module'
)
level
=
'module'
)
ast
=
TreeFragment
.
SetPosTransform
(
self
.
node
.
pos
)(
fragment
.
root
)
ast
=
TreeFragment
.
SetPosTransform
(
self
.
node
.
pos
)(
fragment
.
root
)
UtilityCode
.
declare_declarations_in_scope
(
decl_code
.
getvalue
(),
env
)
UtilityCode
.
declare_declarations_in_scope
(
decl_code
.
getvalue
(),
env
)
ast
.
scope
=
env
ast
.
scope
=
env
...
...
Cython/Compiler/Importer.py
View file @
719a49e2
...
@@ -40,7 +40,7 @@ def importer(modulename, compile=False, version=None):
...
@@ -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
Otherwise, try a regular import and if that fails (i.e. there is a
syntax error, try to compile it.
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
)
return
_import_normal
(
modulename
)
if
compile
:
if
compile
:
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
719a49e2
...
@@ -1489,7 +1489,8 @@ if VALUE is not None:
...
@@ -1489,7 +1489,8 @@ if VALUE is not None:
return
node
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
)
node
=
FusedNode
.
FusedCFuncDefNode
(
node
,
env
)
self
.
fused_function
=
node
self
.
fused_function
=
node
...
...
runtests.py
View file @
719a49e2
...
@@ -1251,6 +1251,8 @@ def refactor_for_py3(distdir, cy3_dir):
...
@@ -1251,6 +1251,8 @@ def refactor_for_py3(distdir, cy3_dir):
recursive-include Cython *.py *.pyx *.pxd
recursive-include Cython *.py *.pyx *.pxd
recursive-include Cython/Debugger/Tests *
recursive-include Cython/Debugger/Tests *
recursive-include Cython/Utility *
recursive-include Cython/Utility *
recursive-exclude pyximport test
include pyximport/*.py
include runtests.py
include runtests.py
include cython.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