Merge "repo_pull: Fix ungrouped-imports warnings" am: 80e39b9d5c am: 8effe40083 am: a9ae82c091
Original change: https://android-review.googlesource.com/c/platform/development/+/1363357 Change-Id: Ia65481ed0f864796b61f34086e98246b9b7af380
This commit is contained in:
@@ -28,28 +28,23 @@ import sys
|
||||
import xml.dom.minidom
|
||||
|
||||
try:
|
||||
from urllib.error import HTTPError # PY3
|
||||
except ImportError:
|
||||
from urllib2 import HTTPError # PY2
|
||||
|
||||
try:
|
||||
# PY3
|
||||
from urllib.error import HTTPError
|
||||
from urllib.parse import urlencode, urlparse
|
||||
from urllib.request import (
|
||||
HTTPBasicAuthHandler, Request, build_opener) # PY3
|
||||
HTTPBasicAuthHandler, Request, build_opener
|
||||
)
|
||||
except ImportError:
|
||||
# PY2
|
||||
from urllib import urlencode
|
||||
from urllib2 import (
|
||||
HTTPBasicAuthHandler, Request, build_opener) # PY2
|
||||
HTTPBasicAuthHandler, HTTPError, Request, build_opener
|
||||
)
|
||||
from urlparse import urlparse
|
||||
|
||||
try:
|
||||
# pylint: disable=ungrouped-imports
|
||||
from urllib.parse import urlencode, urlparse # PY3
|
||||
except ImportError:
|
||||
# pylint: disable=ungrouped-imports
|
||||
from urllib import urlencode # PY2
|
||||
from urlparse import urlparse # PY2
|
||||
|
||||
|
||||
try:
|
||||
from subprocess import PIPE, run # PY3.5
|
||||
# PY3.5
|
||||
from subprocess import PIPE, run
|
||||
except ImportError:
|
||||
from subprocess import CalledProcessError, PIPE, Popen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user