Permalink
Browse files

tools: make mkssldef.py Python 3 compatible

This patch replaces the usage of `map` in such a way that it will be
compatible with Python 3.

PR-URL: #25584
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
thefourtheye authored and addaleax committed Jan 19, 2019
1 parent c7dbb72 commit e6ad7f4c9c647e4a36da0b5c561efb286c4d3e34
Showing with 2 additions and 2 deletions.
  1. +2 −2 tools/mkssldef.py
@@ -21,13 +21,13 @@
elif option.startswith('-X'): excludes += option[2:].split(',')
elif option.startswith('-B'): bases += option[2:].split(',')

excludes = map(re.compile, excludes)
excludes = [re.compile(exclude) for exclude in excludes]
exported = []

for filename in filenames:
for line in open(filename).readlines():
name, _, _, meta, _ = re.split('\s+', line)
if any(map(lambda p: p.match(name), excludes)): continue
if any(p.match(name) for p in excludes): continue
meta = meta.split(':')
assert meta[0] in ('EXIST', 'NOEXIST')
assert meta[2] in ('FUNCTION', 'VARIABLE')

0 comments on commit e6ad7f4

Please sign in to comment.