mirror of
https://github.com/kennethreitz/requests3.git
synced 2026-06-05 23:10:16 +00:00
Remove path hacks that break chardet in Python 3. Closes #858.
This replaces the sys.path hack with a slightly less objectionable sys.modules hack. Both have the effect of making the vendored lib's absolue imports work as expected when oauthlib isn't installed. The sys.modules hack doesn't insert the rest of the vendored crap in a global path, however.
This commit is contained in:
+2
-3
@@ -16,9 +16,8 @@ try:
|
||||
from oauthlib.common import extract_params
|
||||
from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
|
||||
except ImportError:
|
||||
directory = os.path.dirname(__file__)
|
||||
path = os.path.join(directory, 'packages')
|
||||
sys.path.insert(0, path)
|
||||
from .packages import oauthlib
|
||||
sys.modules['oauthlib'] = oauthlib
|
||||
from oauthlib.oauth1 import rfc5849
|
||||
from oauthlib.common import extract_params
|
||||
from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
|
||||
|
||||
Reference in New Issue
Block a user