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
caa2fe39
Commit
caa2fe39
authored
Jul 25, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make some imports compatible with Py2/Py3
parent
4a761906
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
20 deletions
+20
-20
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+7
-1
Cython/Compiler/TreeFragment.py
Cython/Compiler/TreeFragment.py
+1
-1
Cython/StringIOTree.py
Cython/StringIOTree.py
+1
-1
Cython/Tempita/_tempita.py
Cython/Tempita/_tempita.py
+6
-6
Cython/Tests/xmlrunner.py
Cython/Tests/xmlrunner.py
+3
-1
runtests.py
runtests.py
+1
-9
No files found.
Cython/Compiler/Annotate.py
View file @
caa2fe39
...
@@ -11,7 +11,7 @@ from datetime import datetime
...
@@ -11,7 +11,7 @@ from datetime import datetime
from
functools
import
partial
from
functools
import
partial
from
collections
import
defaultdict
from
collections
import
defaultdict
from
xml.sax.saxutils
import
escape
as
html_escape
from
xml.sax.saxutils
import
escape
as
html_escape
from
StringIO
import
StringIO
from
io
import
StringIO
from
.
import
Version
from
.
import
Version
from
.Code
import
CCodeWriter
from
.Code
import
CCodeWriter
...
...
Cython/Compiler/Symtab.py
View file @
caa2fe39
...
@@ -6,6 +6,12 @@ from __future__ import absolute_import
...
@@ -6,6 +6,12 @@ from __future__ import absolute_import
import
copy
import
copy
import
re
import
re
try
:
import
__builtin__
as
builtins
except
ImportError
:
# Py3
import
builtins
from
.Errors
import
warning
,
error
,
InternalError
from
.Errors
import
warning
,
error
,
InternalError
from
.StringEncoding
import
EncodedString
from
.StringEncoding
import
EncodedString
from
.
import
Options
,
Naming
from
.
import
Options
,
Naming
...
@@ -14,8 +20,8 @@ from .PyrexTypes import py_object_type, unspecified_type
...
@@ -14,8 +20,8 @@ from .PyrexTypes import py_object_type, unspecified_type
from
.TypeSlots
import
\
from
.TypeSlots
import
\
pyfunction_signature
,
pymethod_signature
,
\
pyfunction_signature
,
pymethod_signature
,
\
get_special_method_signature
,
get_property_accessor_signature
get_special_method_signature
,
get_property_accessor_signature
from
.
import
Code
from
.
import
Code
import
__builtin__
as
builtins
iso_c99_keywords
=
set
(
iso_c99_keywords
=
set
(
[
'auto'
,
'break'
,
'case'
,
'char'
,
'const'
,
'continue'
,
'default'
,
'do'
,
[
'auto'
,
'break'
,
'case'
,
'char'
,
'const'
,
'continue'
,
'default'
,
'do'
,
...
...
Cython/Compiler/TreeFragment.py
View file @
caa2fe39
...
@@ -9,7 +9,7 @@ Support for parsing strings into code trees.
...
@@ -9,7 +9,7 @@ Support for parsing strings into code trees.
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
re
import
re
from
StringIO
import
StringIO
from
io
import
StringIO
from
.Scanning
import
PyrexScanner
,
StringSourceDescriptor
from
.Scanning
import
PyrexScanner
,
StringSourceDescriptor
from
.Symtab
import
ModuleScope
from
.Symtab
import
ModuleScope
...
...
Cython/StringIOTree.py
View file @
caa2fe39
from
cStringIO
import
StringIO
from
io
import
StringIO
class
StringIOTree
(
object
):
class
StringIOTree
(
object
):
...
...
Cython/Tempita/_tempita.py
View file @
caa2fe39
...
@@ -29,6 +29,8 @@ can use ``__name='tmpl.html'`` to set the name of the template.
...
@@ -29,6 +29,8 @@ can use ``__name='tmpl.html'`` to set the name of the template.
If there are syntax errors ``TemplateError`` will be raised.
If there are syntax errors ``TemplateError`` will be raised.
"""
"""
from
__future__
import
absolute_import
import
re
import
re
import
sys
import
sys
import
cgi
import
cgi
...
@@ -38,12 +40,10 @@ except ImportError: # Py3
...
@@ -38,12 +40,10 @@ except ImportError: # Py3
from
urllib.parse
import
quote
as
url_quote
from
urllib.parse
import
quote
as
url_quote
import
os
import
os
import
tokenize
import
tokenize
try
:
from
io
import
StringIO
from
io
import
StringIO
except
ImportError
:
from
._looper
import
looper
from
cStringIO
import
StringIO
from
.compat3
import
bytes
,
basestring_
,
next
,
is_unicode
,
coerce_text
from
Cython.Tempita._looper
import
looper
from
Cython.Tempita.compat3
import
bytes
,
basestring_
,
next
,
is_unicode
,
coerce_text
__all__
=
[
'TemplateError'
,
'Template'
,
'sub'
,
'HTMLTemplate'
,
__all__
=
[
'TemplateError'
,
'Template'
,
'sub'
,
'HTMLTemplate'
,
'sub_html'
,
'html'
,
'bunch'
]
'sub_html'
,
'html'
,
'bunch'
]
...
...
Cython/Tests/xmlrunner.py
View file @
caa2fe39
...
@@ -38,11 +38,13 @@ if __name__ == '__main__':
...
@@ -38,11 +38,13 @@ if __name__ == '__main__':
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
"""
"""
from
__future__
import
absolute_import
import
os
import
os
import
sys
import
sys
import
time
import
time
from
unittest
import
TestResult
,
_TextTestResult
,
TextTestRunner
from
unittest
import
TestResult
,
_TextTestResult
,
TextTestRunner
from
cStringIO
import
StringIO
from
io
import
StringIO
import
xml.dom.minidom
import
xml.dom.minidom
...
...
runtests.py
View file @
caa2fe39
...
@@ -23,21 +23,13 @@ except (ImportError, AttributeError):
...
@@ -23,21 +23,13 @@ except (ImportError, AttributeError):
IS_CPYTHON
=
True
IS_CPYTHON
=
True
IS_PYPY
=
False
IS_PYPY
=
False
try
:
from
io
import
StringIO
,
open
as
io_open
from
StringIO
import
StringIO
except
ImportError
:
from
io
import
StringIO
try
:
try
:
import
cPickle
as
pickle
import
cPickle
as
pickle
except
ImportError
:
except
ImportError
:
import
pickle
import
pickle
try
:
from
io
import
open
as
io_open
except
ImportError
:
from
codecs
import
open
as
io_open
try
:
try
:
import
threading
import
threading
except
ImportError
:
# No threads, no problems
except
ImportError
:
# No threads, no problems
...
...
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