Merge "repo_pull: Fix ungrouped-imports warnings" am: 80e39b9d5c am: 8effe40083

Original change: https://android-review.googlesource.com/c/platform/development/+/1363357

Change-Id: Iac4ab79f1cf649eb3a861fd46bf63b9dc6c9ef61
This commit is contained in:
Yo Chiang
2020-07-20 09:11:32 +00:00
committed by Automerger Merge Worker

View File

@@ -28,28 +28,23 @@ import sys
import xml.dom.minidom import xml.dom.minidom
try: try:
from urllib.error import HTTPError # PY3 # PY3
except ImportError: from urllib.error import HTTPError
from urllib2 import HTTPError # PY2 from urllib.parse import urlencode, urlparse
try:
from urllib.request import ( from urllib.request import (
HTTPBasicAuthHandler, Request, build_opener) # PY3 HTTPBasicAuthHandler, Request, build_opener
)
except ImportError: except ImportError:
# PY2
from urllib import urlencode
from urllib2 import ( from urllib2 import (
HTTPBasicAuthHandler, Request, build_opener) # PY2 HTTPBasicAuthHandler, HTTPError, Request, build_opener
)
from urlparse import urlparse
try: try:
# pylint: disable=ungrouped-imports # PY3.5
from urllib.parse import urlencode, urlparse # PY3 from subprocess import PIPE, run
except ImportError:
# pylint: disable=ungrouped-imports
from urllib import urlencode # PY2
from urlparse import urlparse # PY2
try:
from subprocess import PIPE, run # PY3.5
except ImportError: except ImportError:
from subprocess import CalledProcessError, PIPE, Popen from subprocess import CalledProcessError, PIPE, Popen