diff options
| author | Mike Frysinger <vapier@google.com> | 2019-06-13 02:24:21 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2021-01-06 18:53:58 +0000 |
| commit | acf63b28928b33d1335dfed1af7e2d8fc6bb5fc4 (patch) | |
| tree | e7b65524857d00cec6b36c989659afd1132d15ce /subcmds | |
| parent | 784ccfc040dc8efa1a64d3c7d4070b66beb15d08 (diff) | |
| download | git-repo-acf63b28928b33d1335dfed1af7e2d8fc6bb5fc4.tar.gz | |
drop pyversion & is_python3 checking
We're committed to Python 3 at this point, so purge all the
is_python3 related dynamic checks.
Bug: https://crbug.com/gerrit/10418
Change-Id: I4c8b405d6de359b8b83223c9f4b9c8ffa18ea1a2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292383
Reviewed-by: Chris Mcdonald <cjmcdonald@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/gitc_delete.py | 4 | ||||
| -rw-r--r-- | subcmds/init.py | 10 | ||||
| -rw-r--r-- | subcmds/sync.py | 25 | ||||
| -rw-r--r-- | subcmds/upload.py | 5 |
4 files changed, 6 insertions, 38 deletions
diff --git a/subcmds/gitc_delete.py b/subcmds/gitc_delete.py index c6f02607..56e0eaba 100644 --- a/subcmds/gitc_delete.py +++ b/subcmds/gitc_delete.py | |||
| @@ -17,10 +17,6 @@ import sys | |||
| 17 | from command import Command, GitcClientCommand | 17 | from command import Command, GitcClientCommand |
| 18 | import platform_utils | 18 | import platform_utils |
| 19 | 19 | ||
| 20 | from pyversion import is_python3 | ||
| 21 | if not is_python3(): | ||
| 22 | input = raw_input # noqa: F821 | ||
| 23 | |||
| 24 | 20 | ||
| 25 | class GitcDelete(Command, GitcClientCommand): | 21 | class GitcDelete(Command, GitcClientCommand): |
| 26 | common = True | 22 | common = True |
diff --git a/subcmds/init.py b/subcmds/init.py index e078fcbe..1bcf5463 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -17,15 +17,7 @@ import os | |||
| 17 | import platform | 17 | import platform |
| 18 | import re | 18 | import re |
| 19 | import sys | 19 | import sys |
| 20 | 20 | import urllib.parse | |
| 21 | from pyversion import is_python3 | ||
| 22 | if is_python3(): | ||
| 23 | import urllib.parse | ||
| 24 | else: | ||
| 25 | import imp | ||
| 26 | import urlparse | ||
| 27 | urllib = imp.new_module('urllib') | ||
| 28 | urllib.parse = urlparse | ||
| 29 | 21 | ||
| 30 | from color import Coloring | 22 | from color import Coloring |
| 31 | from command import InteractiveCommand, MirrorSafeCommand | 23 | from command import InteractiveCommand, MirrorSafeCommand |
diff --git a/subcmds/sync.py b/subcmds/sync.py index 1e1f2fc1..3482946d 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. | 13 | # limitations under the License. |
| 14 | 14 | ||
| 15 | import http.cookiejar as cookielib | ||
| 15 | import json | 16 | import json |
| 16 | import netrc | 17 | import netrc |
| 17 | from optparse import SUPPRESS_HELP | 18 | from optparse import SUPPRESS_HELP |
| @@ -22,26 +23,10 @@ import subprocess | |||
| 22 | import sys | 23 | import sys |
| 23 | import tempfile | 24 | import tempfile |
| 24 | import time | 25 | import time |
| 25 | 26 | import urllib.error | |
| 26 | from pyversion import is_python3 | 27 | import urllib.parse |
| 27 | if is_python3(): | 28 | import urllib.request |
| 28 | import http.cookiejar as cookielib | 29 | import xmlrpc.client |
| 29 | import urllib.error | ||
| 30 | import urllib.parse | ||
| 31 | import urllib.request | ||
| 32 | import xmlrpc.client | ||
| 33 | else: | ||
| 34 | import cookielib | ||
| 35 | import imp | ||
| 36 | import urllib2 | ||
| 37 | import urlparse | ||
| 38 | import xmlrpclib | ||
| 39 | urllib = imp.new_module('urllib') | ||
| 40 | urllib.error = urllib2 | ||
| 41 | urllib.parse = urlparse | ||
| 42 | urllib.request = urllib2 | ||
| 43 | xmlrpc = imp.new_module('xmlrpc') | ||
| 44 | xmlrpc.client = xmlrpclib | ||
| 45 | 30 | ||
| 46 | try: | 31 | try: |
| 47 | import threading as _threading | 32 | import threading as _threading |
diff --git a/subcmds/upload.py b/subcmds/upload.py index c189e65f..50dccc52 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -23,11 +23,6 @@ from git_command import GitCommand | |||
| 23 | from git_refs import R_HEADS | 23 | from git_refs import R_HEADS |
| 24 | from hooks import RepoHook | 24 | from hooks import RepoHook |
| 25 | 25 | ||
| 26 | from pyversion import is_python3 | ||
| 27 | if not is_python3(): | ||
| 28 | input = raw_input # noqa: F821 | ||
| 29 | else: | ||
| 30 | unicode = str | ||
| 31 | 26 | ||
| 32 | UNUSUAL_COMMIT_THRESHOLD = 5 | 27 | UNUSUAL_COMMIT_THRESHOLD = 5 |
| 33 | 28 | ||
