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 <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
thefourtheye authored and BethGriggs committed May 10, 2019
1 parent faf45a7 commit 58b23f9
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 58b23f9

Please sign in to comment.