Skip to content

Commit

Permalink
tools: make mkssldef.py Python 3 compatible
Browse files Browse the repository at this point in the history
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 28, 2019
1 parent c7dbb72 commit e6ad7f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/mkssldef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e6ad7f4

Please sign in to comment.