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 /git_config.py | |
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 'git_config.py')
-rw-r--r-- | git_config.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/git_config.py b/git_config.py index fd8e9268..2fa43a1e 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | import contextlib | 15 | import contextlib |
16 | import errno | 16 | import errno |
17 | from http.client import HTTPException | ||
17 | import json | 18 | import json |
18 | import os | 19 | import os |
19 | import re | 20 | import re |
@@ -26,25 +27,12 @@ try: | |||
26 | except ImportError: | 27 | except ImportError: |
27 | import dummy_threading as _threading | 28 | import dummy_threading as _threading |
28 | import time | 29 | import time |
29 | 30 | import urllib.error | |
30 | from pyversion import is_python3 | 31 | import urllib.request |
31 | if is_python3(): | ||
32 | import urllib.request | ||
33 | import urllib.error | ||
34 | else: | ||
35 | import urllib2 | ||
36 | import imp | ||
37 | urllib = imp.new_module('urllib') | ||
38 | urllib.request = urllib2 | ||
39 | urllib.error = urllib2 | ||
40 | 32 | ||
41 | from error import GitError, UploadError | 33 | from error import GitError, UploadError |
42 | import platform_utils | 34 | import platform_utils |
43 | from repo_trace import Trace | 35 | from repo_trace import Trace |
44 | if is_python3(): | ||
45 | from http.client import HTTPException | ||
46 | else: | ||
47 | from httplib import HTTPException | ||
48 | 36 | ||
49 | from git_command import GitCommand | 37 | from git_command import GitCommand |
50 | from git_command import ssh_sock | 38 | from git_command import ssh_sock |
@@ -341,8 +329,6 @@ class GitConfig(object): | |||
341 | d = self._do('--null', '--list') | 329 | d = self._do('--null', '--list') |
342 | if d is None: | 330 | if d is None: |
343 | return c | 331 | return c |
344 | if not is_python3(): | ||
345 | d = d.decode('utf-8') | ||
346 | for line in d.rstrip('\0').split('\0'): | 332 | for line in d.rstrip('\0').split('\0'): |
347 | if '\n' in line: | 333 | if '\n' in line: |
348 | key, val = line.split('\n', 1) | 334 | key, val = line.split('\n', 1) |