From 685f080d626ccdc7ed0d76cccb38810285fc40e0 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 14 Nov 2012 08:34:39 +0900 Subject: [PATCH] More code style cleanup Clean up a few more unnecessary usages of lambda in `repo` that were missed in the previous sweep that only considered files ending in .py. Remove a duplicate import. Change-Id: I03cf467a5630cbe4eee6649520c52e94a7db76be --- main.py | 1 - repo | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index f41fb803..9fbccfb9 100755 --- a/main.py +++ b/main.py @@ -28,7 +28,6 @@ except ImportError: import urllib.request else: # For python2 - import imp urllib = imp.new_module('urllib') urllib.request = urllib2 diff --git a/repo b/repo index 96302c0e..e06a5d5c 100755 --- a/repo +++ b/repo @@ -275,9 +275,9 @@ def _CheckGitVersion(): raise CloneFailure() ver_str = ver_str[len('git version '):].strip() - ver_act = tuple(map(lambda x: int(x), ver_str.split('.')[0:3])) + ver_act = tuple(map(int, ver_str.split('.')[0:3])) if ver_act < MIN_GIT_VERSION: - need = '.'.join(map(lambda x: str(x), MIN_GIT_VERSION)) + need = '.'.join(map(str, MIN_GIT_VERSION)) print >>sys.stderr, 'fatal: git %s or later required' % need raise CloneFailure() @@ -294,7 +294,7 @@ def NeedSetupGnuPG(): if not kv: return True - kv = tuple(map(lambda x: int(x), kv.split('.'))) + kv = tuple(map(int, kv.split('.'))) if kv < KEYRING_VERSION: return True return False @@ -343,7 +343,7 @@ def SetupGnuPG(quiet): print fd = open(os.path.join(home_dot_repo, 'keyring-version'), 'w') - fd.write('.'.join(map(lambda x: str(x), KEYRING_VERSION)) + '\n') + fd.write('.'.join(map(str, KEYRING_VERSION)) + '\n') fd.close() return True @@ -725,7 +725,7 @@ def main(orig_args): if my_main: repo_main = my_main - ver_str = '.'.join(map(lambda x: str(x), VERSION)) + ver_str = '.'.join(map(str, VERSION)) me = [repo_main, '--repo-dir=%s' % rel_repo_dir, '--wrapper-version=%s' % ver_str,