Skip to content

Commit

Permalink
Merge pull request psf#736 from Lukasa/develop
Browse files Browse the repository at this point in the history
Make OAuth path hack platform independent.
  • Loading branch information
Kenneth Reitz committed Jul 27, 2012
2 parents 0af7ca7 + 55237ad commit 0d9ab27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions requests/_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,8 +16,9 @@
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)

0 comments on commit 0d9ab27

Please sign in to comment.