Even more coding style cleanup
Fixing some more pylint warnings:
W1401: Anomalous backslash in string
W0623: Redefining name 'name' from outer scope
W0702: No exception type(s) specified
E0102: name: function already defined line n
Change-Id: I5afcdb4771ce210390a79981937806e30900a93c
diff --git a/subcmds/grep.py b/subcmds/grep.py
index 0dc8f9f..b067629 100644
--- a/subcmds/grep.py
+++ b/subcmds/grep.py
@@ -51,7 +51,7 @@
Look for a line that has '#define' and either 'MAX_PATH or 'PATH_MAX':
- repo grep -e '#define' --and -\( -e MAX_PATH -e PATH_MAX \)
+ repo grep -e '#define' --and -\\( -e MAX_PATH -e PATH_MAX \\)
Look for a line that has 'NODE' or 'Unexpected' in files that
contain a line that matches both expressions:
diff --git a/subcmds/init.py b/subcmds/init.py
index e56b922..48df9e8 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -147,7 +147,7 @@
r.ResetFetch()
r.Save()
- groups = re.split('[,\s]+', opt.groups)
+ groups = re.split(r'[,\s]+', opt.groups)
all_platforms = ['linux', 'darwin']
platformize = lambda x: 'platform-' + x
if opt.platform == 'auto':
diff --git a/subcmds/sync.py b/subcmds/sync.py
index d4637d0..8e9477a 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -696,7 +696,7 @@
try:
try:
self._times = pickle.load(f)
- except:
+ except IOError:
try:
os.remove(self._path)
except OSError:
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 84a5e44..39721ac 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -297,7 +297,7 @@
try:
# refs/changes/XYZ/N --> XYZ
return refs.get(last_pub).split('/')[-2]
- except:
+ except (AttributeError, IndexError):
return ""
def _UploadAndReport(self, opt, todo, original_people):