Merge pull request #736 from Lukasa/develop

Make OAuth path hack platform independent.
This commit is contained in:
Kenneth Reitz
2012-07-26 22:29:58 -07:00
+5 -4
View File
@@ -4,8 +4,8 @@
requests._oauth
~~~~~~~~~~~~~~~
This module comtains the path hack neccesary for oauthlib to be vendored into requests
while allowing upstream changes.
This module contains the path hack necessary for oauthlib to be vendored into
requests while allowing upstream changes.
"""
import os
@@ -16,8 +16,9 @@ try:
from oauthlib.common import extract_params
from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
except ImportError:
path = os.path.abspath('/'.join(__file__.split('/')[:-1]+['packages']))
directory = os.path.dirname(__file__)
path = os.path.join(directory, 'packages')
sys.path.insert(0, path)
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)