Commit 519c3a2b authored by Robert Bradshaw's avatar Robert Bradshaw

Fix Python3 next, encoding.

parent a687fae6
...@@ -68,6 +68,12 @@ try: ...@@ -68,6 +68,12 @@ try:
except NameError: except NameError:
basestring = str basestring = str
try:
next
except NameError:
def next(iter):
return iter.next()
WITH_CYTHON = True WITH_CYTHON = True
CY3_DIR = None CY3_DIR = None
...@@ -165,7 +171,7 @@ def def_to_cdef(source): ...@@ -165,7 +171,7 @@ def def_to_cdef(source):
else: else:
args_no_types = "" args_no_types = ""
output.append("def %s(%s):" % (name, args_no_types)) output.append("def %s(%s):" % (name, args_no_types))
line = lines.next() line = next(lines)
if '"""' in line: if '"""' in line:
has_docstring = True has_docstring = True
output.append(line) output.append(line)
...@@ -742,7 +748,7 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -742,7 +748,7 @@ class CythonCompileTestCase(unittest.TestCase):
if self.preparse and self.preparse != 'id': if self.preparse and self.preparse != 'id':
preparse_func = globals()[self.preparse] preparse_func = globals()[self.preparse]
def copy(src, dest): def copy(src, dest):
open(dest, 'wb').write(preparse_func(open(src).read())) open(dest, 'w').write(preparse_func(open(src).read()))
else: else:
# use symlink on Unix, copy on Windows # use symlink on Unix, copy on Windows
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment