Commit 15e0eae3 authored by Stefan Behnel's avatar Stefan Behnel

adapt usages of map() to Py2/Py3

parent 1e61ef14
......@@ -62,9 +62,9 @@ def find_package_base(path):
def cython_compile(path_pattern, options):
pool = None
paths = map(os.path.abspath, extended_iglob(path_pattern))
all_paths = map(os.path.abspath, extended_iglob(path_pattern))
try:
for path in paths:
for path in all_paths:
if options.build_inplace:
base_dir = path
while not os.path.isdir(base_dir) or is_package_dir(base_dir):
......
......@@ -2536,7 +2536,7 @@ class CFuncType(CType):
self.is_strict_signature = is_strict_signature
def __repr__(self):
arg_reprs = map(repr, self.args)
arg_reprs = list(map(repr, self.args))
if self.has_varargs:
arg_reprs.append("...")
if self.exception_value:
......
......@@ -289,7 +289,7 @@ def split_string_literal(s, limit=2000):
def encode_pyunicode_string(s):
"""Create Py_UNICODE[] representation of a given unicode string.
"""
s = map(ord, s) + [0]
s = list(map(ord, s)) + [0]
if sys.maxunicode >= 0x10000: # Wide build or Py3.3
utf16, utf32 = [], s
......
......@@ -731,7 +731,7 @@ class CyImport(CythonCommand):
for marker in module.find('LineNumberMapping'):
cython_lineno = int(marker.attrib['cython_lineno'])
c_linenos = map(int, marker.attrib['c_linenos'].split())
c_linenos = list(map(int, marker.attrib['c_linenos'].split()))
cython_module.lineno_cy2c[cython_lineno] = min(c_linenos)
for c_lineno in c_linenos:
cython_module.lineno_c2cy[c_lineno] = cython_lineno
......
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