Files
requests3/requests/_oauth.py
T
Gabriel c03553ed4a 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.
2012-10-21 17:07:12 +02:00

24 lines
668 B
Python

# -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module contains the path hack necessary for oauthlib to be vendored into
requests while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
except ImportError:
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)