From 79aa9edde1bba39a433475929970dd519fecfdf3 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Sat, 21 Jul 2012 18:11:00 +0100 Subject: [PATCH 1/2] Make OAuth path hack platform independent. --- requests/_oauth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/requests/_oauth.py b/requests/_oauth.py index 8f44bf56..7105a602 100644 --- a/requests/_oauth.py +++ b/requests/_oauth.py @@ -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) \ No newline at end of file + from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER) From 55237ad67dddaf070a40ea1ab64f84799356edfa Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 25 Jul 2012 13:24:38 +0100 Subject: [PATCH 2/2] Comment typo fix and move newline. --- requests/_oauth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/_oauth.py b/requests/_oauth.py index 7105a602..165e937e 100644 --- a/requests/_oauth.py +++ b/requests/_oauth.py @@ -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