From acf63b28928b33d1335dfed1af7e2d8fc6bb5fc4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 13 Jun 2019 02:24:21 -0400 Subject: 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 Tested-by: Mike Frysinger --- git_config.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'git_config.py') 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 @@ import contextlib import errno +from http.client import HTTPException import json import os import re @@ -26,25 +27,12 @@ try: except ImportError: import dummy_threading as _threading import time - -from pyversion import is_python3 -if is_python3(): - import urllib.request - import urllib.error -else: - import urllib2 - import imp - urllib = imp.new_module('urllib') - urllib.request = urllib2 - urllib.error = urllib2 +import urllib.error +import urllib.request from error import GitError, UploadError import platform_utils from repo_trace import Trace -if is_python3(): - from http.client import HTTPException -else: - from httplib import HTTPException from git_command import GitCommand from git_command import ssh_sock @@ -341,8 +329,6 @@ class GitConfig(object): d = self._do('--null', '--list') if d is None: return c - if not is_python3(): - d = d.decode('utf-8') for line in d.rstrip('\0').split('\0'): if '\n' in line: key, val = line.split('\n', 1) -- cgit v1.2.3-54-g00ecf