Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit c7cfef5

Browse files
committed
Replace usage of map unsupported on Python 3
In Python 3, map returns a map object not a list. Replaced the occurrences I could find with list comprehensions.
1 parent 59006ac commit c7cfef5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ckanext/example_idatastorebackend/example_sqlite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def resource_id_from_alias(self, alias):
113113
return False, alias
114114

115115
def get_all_ids(self):
116-
return map(lambda t: t.name, self._get_engine().execute(
116+
return [t.name for t in self._get_engine().execute(
117117
u'''
118118
select name from sqlite_master
119119
where type = "table"'''
120-
).fetchall())
120+
).fetchall()]

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#
2626

2727
def parse_version(s):
28-
return map(int, s.split('.'))
28+
return [int(part) for part in s.split('.')]
29+
30+
2931

3032
HERE = os.path.dirname(__file__)
3133
with open(os.path.join(HERE, 'requirement-setuptools.txt')) as f:

0 commit comments

Comments
 (0)