summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2019-06-13 02:24:21 -0400
committerMike Frysinger <vapier@google.com>2021-01-06 18:53:58 +0000
commitacf63b28928b33d1335dfed1af7e2d8fc6bb5fc4 (patch)
treee7b65524857d00cec6b36c989659afd1132d15ce /git_config.py
parent784ccfc040dc8efa1a64d3c7d4070b66beb15d08 (diff)
downloadgit-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.py20
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
15import contextlib 15import contextlib
16import errno 16import errno
17from http.client import HTTPException
17import json 18import json
18import os 19import os
19import re 20import re
@@ -26,25 +27,12 @@ try:
26except ImportError: 27except ImportError:
27 import dummy_threading as _threading 28 import dummy_threading as _threading
28import time 29import time
29 30import urllib.error
30from pyversion import is_python3 31import urllib.request
31if is_python3():
32 import urllib.request
33 import urllib.error
34else:
35 import urllib2
36 import imp
37 urllib = imp.new_module('urllib')
38 urllib.request = urllib2
39 urllib.error = urllib2
40 32
41from error import GitError, UploadError 33from error import GitError, UploadError
42import platform_utils 34import platform_utils
43from repo_trace import Trace 35from repo_trace import Trace
44if is_python3():
45 from http.client import HTTPException
46else:
47 from httplib import HTTPException
48 36
49from git_command import GitCommand 37from git_command import GitCommand
50from git_command import ssh_sock 38from 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)