diff options
author | David Pursehouse <dpursehouse@collab.net> | 2020-02-15 12:45:53 +0900 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-15 04:45:16 +0000 |
commit | a46bf7dc2af111ae4a663d61ed06dc90ddfb8068 (patch) | |
tree | d460327d2cb0b93800f746934cb4f1c4d0007be9 | |
parent | 19a1f22cd0a06eeb1cdea8e81ce7871bd5d6d6a2 (diff) | |
download | git-repo-a46bf7dc2af111ae4a663d61ed06dc90ddfb8068.tar.gz |
flake8: Suppress "F821 undefined name" inline for Python 2 names
All of the instances of this are related to Python 2 names that
don't exist in Python 3, and the warnings are raised when running
flake8 on Python 3.
All of these will go away once we completely remove support for
Python 2, so just suppress them inline. We don't globally suppress
the check so that we will still see legitimate errors if/when they
occur in new code.
Change-Id: Iccf955f50abfc9f83b371fc0af6cceb51037456f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255039
Tested-by: David Pursehouse <dpursehouse@collab.net>
Reviewed-by: Mike Frysinger <vapier@google.com>
-rwxr-xr-x | main.py | 2 | ||||
-rw-r--r-- | platform_utils_win32.py | 4 | ||||
-rw-r--r-- | project.py | 2 | ||||
-rw-r--r-- | subcmds/gitc_delete.py | 2 | ||||
-rw-r--r-- | subcmds/upload.py | 2 |
5 files changed, 6 insertions, 6 deletions
@@ -69,7 +69,7 @@ from wrapper import WrapperPath, Wrapper | |||
69 | from subcmds import all_commands | 69 | from subcmds import all_commands |
70 | 70 | ||
71 | if not is_python3(): | 71 | if not is_python3(): |
72 | input = raw_input | 72 | input = raw_input # noqa: F821 |
73 | 73 | ||
74 | global_options = optparse.OptionParser( | 74 | global_options = optparse.OptionParser( |
75 | usage='repo [-p|--paginate|--no-pager] COMMAND [ARGS]', | 75 | usage='repo [-p|--paginate|--no-pager] COMMAND [ARGS]', |
diff --git a/platform_utils_win32.py b/platform_utils_win32.py index c59db523..a6286374 100644 --- a/platform_utils_win32.py +++ b/platform_utils_win32.py | |||
@@ -219,8 +219,8 @@ def _preserve_encoding(source, target): | |||
219 | if is_python3(): | 219 | if is_python3(): |
220 | return target | 220 | return target |
221 | 221 | ||
222 | if isinstance(source, unicode): | 222 | if isinstance(source, unicode): # noqa: F821 |
223 | return unicode(target) | 223 | return unicode(target) # noqa: F821 |
224 | return str(target) | 224 | return str(target) |
225 | 225 | ||
226 | 226 | ||
@@ -52,7 +52,7 @@ else: | |||
52 | import urlparse | 52 | import urlparse |
53 | urllib = imp.new_module('urllib') | 53 | urllib = imp.new_module('urllib') |
54 | urllib.parse = urlparse | 54 | urllib.parse = urlparse |
55 | input = raw_input | 55 | input = raw_input # noqa: F821 |
56 | 56 | ||
57 | 57 | ||
58 | def _lwrite(path, content): | 58 | def _lwrite(path, content): |
diff --git a/subcmds/gitc_delete.py b/subcmds/gitc_delete.py index 1011276f..24d355a2 100644 --- a/subcmds/gitc_delete.py +++ b/subcmds/gitc_delete.py | |||
@@ -22,7 +22,7 @@ import platform_utils | |||
22 | 22 | ||
23 | from pyversion import is_python3 | 23 | from pyversion import is_python3 |
24 | if not is_python3(): | 24 | if not is_python3(): |
25 | input = raw_input | 25 | input = raw_input # noqa: F821 |
26 | 26 | ||
27 | 27 | ||
28 | class GitcDelete(Command, GitcClientCommand): | 28 | class GitcDelete(Command, GitcClientCommand): |
diff --git a/subcmds/upload.py b/subcmds/upload.py index bc373b3e..ba75a53e 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -27,7 +27,7 @@ from project import RepoHook | |||
27 | 27 | ||
28 | from pyversion import is_python3 | 28 | from pyversion import is_python3 |
29 | if not is_python3(): | 29 | if not is_python3(): |
30 | input = raw_input | 30 | input = raw_input # noqa: F821 |
31 | else: | 31 | else: |
32 | unicode = str | 32 | unicode = str |
33 | 33 | ||