diff options
author | lloyd <[email protected]> | 2010-02-22 20:07:22 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-02-22 20:07:22 +0000 |
commit | b9e801f1d11ad5367e6ac1b4224cfb6045e30123 (patch) | |
tree | de85b874d0e8e3b4d5a29da5c60eb21af82a7a90 /configure.py | |
parent | 40e2f75e3ecafa8d9ea6518780c2f97aae66d93f (diff) |
Use list comprehensions instead of filter/map to minimize changes needed
for 2to3, also nominally more 'Pythonic' for better or worse.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/configure.py b/configure.py index 1f0c9aa00..b4712b171 100755 --- a/configure.py +++ b/configure.py @@ -469,9 +469,9 @@ class ModuleInfo(object): return os.path.join(os.path.split(self.lives_in)[0], *filename.split(':')) - self.source = map(add_dir_name, self.source) - self.header_internal = map(add_dir_name, self.header_internal) - self.header_public = map(add_dir_name, self.header_public) + self.source = [add_dir_name(s) for s in self.source] + self.header_internal = [add_dir_name(s) for s in self.header_internal] + self.header_public = [add_dir_name(s) for s in self.header_public] self.mp_bits = int(self.mp_bits) @@ -530,9 +530,9 @@ class ModuleInfo(object): about any that do not """ def dependencies_exist(self, modules): - all_deps = map(lambda s: s.split('|'), self.dependencies()) + all_deps = [s.split('|') for s in self.dependencies()] - for missing in filter(lambda s: s not in modules, flatten(all_deps)): + for missing in [s for s in flatten(all_deps) if s not in modules]: logging.warn("Module '%s', dep of '%s', does not exist" % ( missing, self.basename)) @@ -1081,8 +1081,7 @@ def choose_modules_to_use(modules, archinfo, options): while dependency_failure: dependency_failure = False for modname in to_load: - for deplist in map(lambda s: s.split('|'), - modules[modname].dependencies()): + for deplist in [s.split('|') for s in modules[modname].dependencies()]: dep_met = False for mod in deplist: @@ -1364,8 +1363,8 @@ def generate_amalgamation(build_config): botan_all_h.write("\n#endif\n") internal_header_amalag = Amalgamation_Generator( - filter(lambda s: s.find('asm_macr_') == -1, - build_config.internal_headers)) + [s for s in build_config.internal_headers + if s.find('asm_macr_') == -1]) botan_all_cpp = open('botan_all.cpp', 'w') |