206 lines
7.4 KiB
Diff
206 lines
7.4 KiB
Diff
From: TANIGUCHI Takaki <takaki@asis.media-as.org>
|
|
Date: Thu, 4 Oct 2018 16:22:43 +0900
|
|
Subject: Don't use duplicated modules
|
|
|
|
---
|
|
botocore/compat.py | 4 ++--
|
|
botocore/endpoint.py | 2 +-
|
|
botocore/exceptions.py | 4 ++--
|
|
botocore/httpsession.py | 4 ++--
|
|
botocore/utils.py | 2 +-
|
|
tests/functional/test_six_threading.py | 4 ++--
|
|
tests/integration/test_client_http.py | 4 ++--
|
|
tests/integration/test_glacier.py | 2 +-
|
|
tests/integration/test_s3.py | 2 +-
|
|
tests/unit/test_endpoint.py | 2 +-
|
|
tests/unit/test_http_client_exception_mapping.py | 4 ++--
|
|
tests/unit/test_http_session.py | 2 +-
|
|
12 files changed, 18 insertions(+), 18 deletions(-)
|
|
|
|
diff --git a/botocore/compat.py b/botocore/compat.py
|
|
index 47e1c81..86d8d3d 100644
|
|
--- a/botocore/compat.py
|
|
+++ b/botocore/compat.py
|
|
@@ -21,7 +21,7 @@ import logging
|
|
import shlex
|
|
from math import floor
|
|
|
|
-from botocore.vendored import six
|
|
+import six
|
|
from botocore.exceptions import MD5UnavailableError
|
|
from urllib3 import exceptions
|
|
|
|
@@ -29,7 +29,7 @@ logger = logging.getLogger(__name__)
|
|
|
|
|
|
if six.PY3:
|
|
- from botocore.vendored.six.moves import http_client
|
|
+ from six.moves import http_client
|
|
|
|
class HTTPHeaders(http_client.HTTPMessage):
|
|
pass
|
|
diff --git a/botocore/endpoint.py b/botocore/endpoint.py
|
|
index efa6be0..6b0599b 100644
|
|
--- a/botocore/endpoint.py
|
|
+++ b/botocore/endpoint.py
|
|
@@ -17,7 +17,7 @@ import logging
|
|
import time
|
|
import threading
|
|
|
|
-from botocore.vendored import six
|
|
+import six
|
|
|
|
from botocore.awsrequest import create_request_object
|
|
from botocore.exceptions import HTTPClientError
|
|
diff --git a/botocore/exceptions.py b/botocore/exceptions.py
|
|
index 36f5867..129ff4d 100644
|
|
--- a/botocore/exceptions.py
|
|
+++ b/botocore/exceptions.py
|
|
@@ -12,8 +12,8 @@
|
|
# ANY KIND, either express or implied. See the License for the specific
|
|
# language governing permissions and limitations under the License.
|
|
from __future__ import unicode_literals
|
|
-from botocore.vendored import requests
|
|
-from botocore.vendored.requests.packages import urllib3
|
|
+import requests
|
|
+from requests.packages import urllib3
|
|
|
|
|
|
class BotoCoreError(Exception):
|
|
diff --git a/botocore/httpsession.py b/botocore/httpsession.py
|
|
index 28ad866..9fe081c 100644
|
|
--- a/botocore/httpsession.py
|
|
+++ b/botocore/httpsession.py
|
|
@@ -18,8 +18,8 @@ except ImportError:
|
|
from urllib3.util.ssl_ import SSLContext
|
|
|
|
import botocore.awsrequest
|
|
-from botocore.vendored import six
|
|
-from botocore.vendored.six.moves.urllib_parse import unquote
|
|
+import six
|
|
+from six.moves.urllib_parse import unquote
|
|
from botocore.compat import filter_ssl_warnings, urlparse
|
|
from botocore.exceptions import (
|
|
ConnectionClosedError, EndpointConnectionError, HTTPClientError,
|
|
diff --git a/botocore/utils.py b/botocore/utils.py
|
|
index 74b4107..1557ded 100644
|
|
--- a/botocore/utils.py
|
|
+++ b/botocore/utils.py
|
|
@@ -31,7 +31,7 @@ import botocore.awsrequest
|
|
import botocore.httpsession
|
|
from botocore.compat import json, quote, zip_longest, urlsplit, urlunsplit
|
|
from botocore.compat import OrderedDict, six, urlparse
|
|
-from botocore.vendored.six.moves.urllib.request import getproxies, proxy_bypass
|
|
+from six.moves.urllib.request import getproxies, proxy_bypass
|
|
from botocore.exceptions import (
|
|
InvalidExpressionError, ConfigNotFound, InvalidDNSNameError, ClientError,
|
|
MetadataRetrievalError, EndpointConnectionError, ReadTimeoutError,
|
|
diff --git a/tests/functional/test_six_threading.py b/tests/functional/test_six_threading.py
|
|
index 5ef9bc3..268304a 100644
|
|
--- a/tests/functional/test_six_threading.py
|
|
+++ b/tests/functional/test_six_threading.py
|
|
@@ -6,7 +6,7 @@ import sys
|
|
import threading
|
|
import time
|
|
|
|
-from botocore.vendored import six
|
|
+import six
|
|
|
|
|
|
_original_setattr = six.moves.__class__.__setattr__
|
|
@@ -51,7 +51,7 @@ class _ExampleThread(threading.Thread):
|
|
|
|
def test_six_thread_safety():
|
|
_reload_six()
|
|
- with patch('botocore.vendored.six.moves.__class__.__setattr__',
|
|
+ with patch('six.moves.__class__.__setattr__',
|
|
wraps=_wrapped_setattr):
|
|
threads = []
|
|
for i in range(2):
|
|
diff --git a/tests/integration/test_client_http.py b/tests/integration/test_client_http.py
|
|
index e5c96f7..5b39e22 100644
|
|
--- a/tests/integration/test_client_http.py
|
|
+++ b/tests/integration/test_client_http.py
|
|
@@ -7,12 +7,12 @@ from contextlib import contextmanager
|
|
|
|
import botocore.session
|
|
from botocore.config import Config
|
|
-from botocore.vendored.six.moves import BaseHTTPServer, socketserver
|
|
+from six.moves import BaseHTTPServer, socketserver
|
|
from botocore.exceptions import (
|
|
ConnectTimeoutError, ReadTimeoutError, EndpointConnectionError,
|
|
ConnectionClosedError,
|
|
)
|
|
-from botocore.vendored.requests import exceptions as requests_exceptions
|
|
+from requests import exceptions as requests_exceptions
|
|
|
|
|
|
class TestClientHTTPBehavior(unittest.TestCase):
|
|
diff --git a/tests/integration/test_glacier.py b/tests/integration/test_glacier.py
|
|
index 23a7f34..96cedf0 100644
|
|
--- a/tests/integration/test_glacier.py
|
|
+++ b/tests/integration/test_glacier.py
|
|
@@ -13,7 +13,7 @@
|
|
from tests import unittest
|
|
|
|
from botocore.exceptions import ClientError
|
|
-from botocore.vendored import six
|
|
+import six
|
|
import botocore.session
|
|
|
|
|
|
diff --git a/tests/integration/test_s3.py b/tests/integration/test_s3.py
|
|
index 1a007aa..e5e5ae3 100644
|
|
--- a/tests/integration/test_s3.py
|
|
+++ b/tests/integration/test_s3.py
|
|
@@ -31,7 +31,7 @@ from botocore.compat import six, zip_longest
|
|
import botocore.session
|
|
import botocore.auth
|
|
import botocore.credentials
|
|
-import botocore.vendored.requests as requests
|
|
+import requests
|
|
from botocore.config import Config
|
|
from botocore.exceptions import ClientError
|
|
|
|
diff --git a/tests/unit/test_endpoint.py b/tests/unit/test_endpoint.py
|
|
index 0cc8ab1..ffcce97 100644
|
|
--- a/tests/unit/test_endpoint.py
|
|
+++ b/tests/unit/test_endpoint.py
|
|
@@ -14,7 +14,7 @@
|
|
from tests import unittest
|
|
|
|
from mock import Mock, patch, sentinel
|
|
-from botocore.vendored.requests import ConnectionError
|
|
+from requests import ConnectionError
|
|
|
|
from botocore.compat import six
|
|
from botocore.awsrequest import AWSRequest
|
|
diff --git a/tests/unit/test_http_client_exception_mapping.py b/tests/unit/test_http_client_exception_mapping.py
|
|
index 9eee38c..7dc759a 100644
|
|
--- a/tests/unit/test_http_client_exception_mapping.py
|
|
+++ b/tests/unit/test_http_client_exception_mapping.py
|
|
@@ -1,8 +1,8 @@
|
|
from nose.tools import assert_raises
|
|
|
|
from botocore import exceptions as botocore_exceptions
|
|
-from botocore.vendored.requests import exceptions as requests_exceptions
|
|
-from botocore.vendored.requests.packages.urllib3 import exceptions as urllib3_exceptions
|
|
+from requests import exceptions as requests_exceptions
|
|
+from requests.packages.urllib3 import exceptions as urllib3_exceptions
|
|
|
|
EXCEPTION_MAPPING = [
|
|
(botocore_exceptions.ReadTimeoutError, requests_exceptions.ReadTimeout),
|
|
diff --git a/tests/unit/test_http_session.py b/tests/unit/test_http_session.py
|
|
index 5568a68..5492c73 100644
|
|
--- a/tests/unit/test_http_session.py
|
|
+++ b/tests/unit/test_http_session.py
|
|
@@ -3,7 +3,7 @@ from tests import unittest
|
|
from nose.tools import raises
|
|
from urllib3.exceptions import NewConnectionError, ProtocolError
|
|
|
|
-from botocore.vendored import six
|
|
+import six
|
|
from botocore.awsrequest import AWSRequest
|
|
from botocore.awsrequest import AWSHTTPConnectionPool, AWSHTTPSConnectionPool
|
|
from botocore.httpsession import get_cert_path
|