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
Kirill Smelkov
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
Hide 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
from
functools
import
partial
from
collections
import
defaultdict
from
xml.sax.saxutils
import
escape
as
html_escape
from
StringIO
import
StringIO
from
io
import
StringIO
from
.
import
Version
from
.Code
import
CCodeWriter
...
...
Cython/Compiler/Symtab.py
View file @
caa2fe39
...
...
@@ -6,6 +6,12 @@ from __future__ import absolute_import
import
copy
import
re
try
:
import
__builtin__
as
builtins
except
ImportError
:
# Py3
import
builtins
from
.Errors
import
warning
,
error
,
InternalError
from
.StringEncoding
import
EncodedString
from
.
import
Options
,
Naming
...
...
@@ -14,8 +20,8 @@ from .PyrexTypes import py_object_type, unspecified_type
from
.TypeSlots
import
\
pyfunction_signature
,
pymethod_signature
,
\
get_special_method_signature
,
get_property_accessor_signature
from
.
import
Code
import
__builtin__
as
builtins
iso_c99_keywords
=
set
(
[
'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.
from
__future__
import
absolute_import
import
re
from
StringIO
import
StringIO
from
io
import
StringIO
from
.Scanning
import
PyrexScanner
,
StringSourceDescriptor
from
.Symtab
import
ModuleScope
...
...
Cython/StringIOTree.py
View file @
caa2fe39
from
cStringIO
import
StringIO
from
io
import
StringIO
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.
If there are syntax errors ``TemplateError`` will be raised.
"""
from
__future__
import
absolute_import
import
re
import
sys
import
cgi
...
...
@@ -38,12 +40,10 @@ except ImportError: # Py3
from
urllib.parse
import
quote
as
url_quote
import
os
import
tokenize
try
:
from
io
import
StringIO
except
ImportError
:
from
cStringIO
import
StringIO
from
Cython.Tempita._looper
import
looper
from
Cython.Tempita.compat3
import
bytes
,
basestring_
,
next
,
is_unicode
,
coerce_text
from
io
import
StringIO
from
._looper
import
looper
from
.compat3
import
bytes
,
basestring_
,
next
,
is_unicode
,
coerce_text
__all__
=
[
'TemplateError'
,
'Template'
,
'sub'
,
'HTMLTemplate'
,
'sub_html'
,
'html'
,
'bunch'
]
...
...
Cython/Tests/xmlrunner.py
View file @
caa2fe39
...
...
@@ -38,11 +38,13 @@ if __name__ == '__main__':
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
"""
from
__future__
import
absolute_import
import
os
import
sys
import
time
from
unittest
import
TestResult
,
_TextTestResult
,
TextTestRunner
from
cStringIO
import
StringIO
from
io
import
StringIO
import
xml.dom.minidom
...
...
runtests.py
View file @
caa2fe39
...
...
@@ -23,21 +23,13 @@ except (ImportError, AttributeError):
IS_CPYTHON
=
True
IS_PYPY
=
False
try
:
from
StringIO
import
StringIO
except
ImportError
:
from
io
import
StringIO
from
io
import
StringIO
,
open
as
io_open
try
:
import
cPickle
as
pickle
except
ImportError
:
import
pickle
try
:
from
io
import
open
as
io_open
except
ImportError
:
from
codecs
import
open
as
io_open
try
:
import
threading
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