Commit 3daa4bf5 authored by Robert Bradshaw's avatar Robert Bradshaw

Py3 fix

parent 86fa66ac
...@@ -64,6 +64,7 @@ if sys.version_info[0] < 3: ...@@ -64,6 +64,7 @@ if sys.version_info[0] < 3:
else: else:
def encode_filename_in_py2(filename): def encode_filename_in_py2(filename):
return filename return filename
basestring = str
def extended_iglob(pattern): def extended_iglob(pattern):
if '**/' in pattern: if '**/' in pattern:
...@@ -148,10 +149,7 @@ distutils_settings = { ...@@ -148,10 +149,7 @@ distutils_settings = {
@cython.locals(start=long, end=long) @cython.locals(start=long, end=long)
def line_iter(source): def line_iter(source):
if isinstance(source, file): if isinstance(source, basestring):
for line in source:
yield line
else:
start = 0 start = 0
while True: while True:
end = source.find('\n', start) end = source.find('\n', start)
...@@ -160,6 +158,9 @@ def line_iter(source): ...@@ -160,6 +158,9 @@ def line_iter(source):
return return
yield source[start:end] yield source[start:end]
start = end+1 start = end+1
else:
for line in source:
yield line
class DistutilsInfo(object): class DistutilsInfo(object):
......
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