murder the defaults
authorKenneth Reitz <me@kennethreitz.com>
Mon, 17 Dec 2012 08:09:07 +0000 (03:09 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Mon, 17 Dec 2012 08:09:07 +0000 (03:09 -0500)
requests/defaults.py [deleted file]
requests/models.py

diff --git a/requests/defaults.py b/requests/defaults.py
deleted file mode 100644 (file)
index c54026c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-requests.defaults
-~~~~~~~~~~~~~~~~~
-
-This module provides the Requests configuration defaults.
-
-Configurations:
-
-:base_headers: Default HTTP headers.
-:max_redirects: Maximum number of redirects allowed within a request.s
-:keep_alive: Reuse HTTP Connections?
-:max_retries: The number of times a request should be retried in the event of a connection failure.
-:pool_maxsize: The maximium size of an HTTP connection pool.
-:pool_connections: The number of active HTTP connection pools to use.
-:encode_uri: If true, URIs will automatically be percent-encoded.
-:trust_env: If true, the surrouding environment will be trusted (environ, netrc).
-"""
-
-SCHEMAS = ['http', 'https']
index 7fe40a5e4f40361986cff5e1ed8eb2b043e09827..4672800881752a5952de9b5395a15e0d37a47aee 100644 (file)
@@ -27,7 +27,7 @@ from .packages.urllib3.exceptions import SSLError as _SSLError
 from .packages.urllib3.exceptions import HTTPError as _HTTPError
 from .packages.urllib3 import connectionpool, poolmanager
 from .packages.urllib3.filepost import encode_multipart_formdata
-from .defaults import SCHEMAS
+
 from .exceptions import (
     ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,
     URLRequired, SSLError, MissingSchema, InvalidSchema, InvalidURL)
@@ -235,9 +235,6 @@ class PreparedRequest(RequestMixin):
         if not scheme:
             raise MissingSchema("Invalid URL %r: No schema supplied" % url)
 
-        if not scheme in SCHEMAS:
-            raise InvalidSchema("Invalid scheme %r" % scheme)
-
         try:
             netloc = netloc.encode('idna').decode('utf-8')
         except UnicodeError: