diff --git a/git_command.py b/git_command.py index 39f795ff..e5e28f3c 100644 --- a/git_command.py +++ b/git_command.py @@ -88,7 +88,7 @@ class _GitCall(object): ver_str = git.version() if ver_str.startswith('git version '): _git_version = tuple( - map(lambda x: int(x), + map(int, ver_str[len('git version '):].strip().split('-')[0].split('.')[0:3] )) else: @@ -110,7 +110,7 @@ def git_require(min_version, fail=False): if min_version <= git_version: return True if fail: - need = '.'.join(map(lambda x: str(x), min_version)) + need = '.'.join(map(str, min_version)) print >>sys.stderr, 'fatal: git %s or later required' % need sys.exit(1) return False diff --git a/git_config.py b/git_config.py index 6589b193..ea782a11 100644 --- a/git_config.py +++ b/git_config.py @@ -537,7 +537,7 @@ class Remote(object): self.url = self._Get('url') self.review = self._Get('review') self.projectname = self._Get('projectname') - self.fetch = map(lambda x: RefSpec.FromString(x), + self.fetch = map(RefSpec.FromString, self._Get('fetch', all_keys=True)) self._review_url = None @@ -657,7 +657,7 @@ class Remote(object): self._Set('url', self.url) self._Set('review', self.review) self._Set('projectname', self.projectname) - self._Set('fetch', map(lambda x: str(x), self.fetch)) + self._Set('fetch', map(str, self.fetch)) def _Set(self, key, value): key = 'remote.%s.%s' % (self.name, key) diff --git a/main.py b/main.py index 10e1cf8c..6236dd3d 100755 --- a/main.py +++ b/main.py @@ -195,12 +195,12 @@ def _CheckWrapperVersion(ver, repo_path): sys.exit(1) exp = _CurrentWrapperVersion() - ver = tuple(map(lambda x: int(x), ver.split('.'))) + ver = tuple(map(int, ver.split('.'))) if len(ver) == 1: ver = (0, ver[0]) + exp_str = '.'.join(map(str, exp)) if exp[0] > ver[0] or ver < (0, 4): - exp_str = '.'.join(map(lambda x: str(x), exp)) print >>sys.stderr, """ !!! A new repo command (%5s) is available. !!! !!! You must upgrade before you can continue: !!! @@ -210,7 +210,6 @@ def _CheckWrapperVersion(ver, repo_path): sys.exit(1) if exp > ver: - exp_str = '.'.join(map(lambda x: str(x), exp)) print >>sys.stderr, """ ... A new repo command (%5s) is available. ... You should upgrade soon: @@ -272,7 +271,7 @@ def _UserAgent(): _user_agent = 'git-repo/%s (%s) git/%s Python/%d.%d.%d' % ( repo_version, os_name, - '.'.join(map(lambda d: str(d), git.version_tuple())), + '.'.join(map(str, git.version_tuple())), py_version[0], py_version[1], py_version[2]) return _user_agent diff --git a/project.py b/project.py index cdb4ecfd..f72b1c8e 100644 --- a/project.py +++ b/project.py @@ -1175,7 +1175,7 @@ class Project(object): cmd = ['fetch', remote.name] cmd.append('refs/changes/%2.2d/%d/%d' \ % (change_id % 100, change_id, patch_id)) - cmd.extend(map(lambda x: str(x), remote.fetch)) + cmd.extend(map(str, remote.fetch)) if GitCommand(self, cmd, bare=True).Wait() != 0: return None return DownloadedChange(self,