mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Remove requests.packages for v3.0.0
As v3.0.0 already includes other backwards incompatible changes, it is a good time to remove the old entry point for vendored packages. Cleans up compatibility shims.
This commit is contained in:
@@ -110,7 +110,6 @@ from .__version__ import __build__, __author__, __author_email__, __license__
|
||||
from .__version__ import __copyright__, __cake__
|
||||
|
||||
from . import utils
|
||||
from . import packages
|
||||
from .models import Request, Response, PreparedRequest
|
||||
from .api import request, get, head, post, patch, put, delete, options
|
||||
from .sessions import session, Session
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import sys
|
||||
|
||||
# This code exists for backwards compatibility reasons.
|
||||
# I don't like it either. Just look the other way. :)
|
||||
|
||||
for package in ('urllib3', 'idna', 'chardet'):
|
||||
locals()[package] = __import__(package)
|
||||
# This traversal is apparently necessary such that the identities are
|
||||
# preserved (requests.packages.urllib3.* is urllib3.*)
|
||||
for mod in list(sys.modules):
|
||||
if mod == package or mod.startswith(package + '.'):
|
||||
sys.modules['requests.packages.' + mod] = sys.modules[mod]
|
||||
|
||||
# Kinda cool, though, right?
|
||||
@@ -1,13 +0,0 @@
|
||||
import requests
|
||||
|
||||
|
||||
def test_can_access_urllib3_attribute():
|
||||
requests.packages.urllib3
|
||||
|
||||
|
||||
def test_can_access_idna_attribute():
|
||||
requests.packages.idna
|
||||
|
||||
|
||||
def test_can_access_chardet_attribute():
|
||||
requests.packages.chardet
|
||||
@@ -82,8 +82,6 @@ class TestRequests:
|
||||
requests.put
|
||||
requests.patch
|
||||
requests.post
|
||||
# Not really an entry point, but people rely on it.
|
||||
from requests.packages.urllib3.poolmanager import PoolManager
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'exception, url', (
|
||||
|
||||
Reference in New Issue
Block a user