Skip to content
Myr

only import oauthlib in python2

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent a5bc99d · Browse files · 1 file+5 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−3 removed

  • other:+5 added−3 removed

1 file+5 added−3 removed

modified:requests/auth.py+5 added-3 removed
9 unmodified lines
10import time11import hashlib1213from base64 import b64encode14from oauthlib.oauth1.rfc5849 import (Client,15 SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)1415from oauthlib.common import extract_params17from .compat import urlparse, str16from .compat import urlparse, str, is_py217from .utils import randombytes, parse_dict_header1819CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded'2021if is_py2:22 from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)2324def _basic_auth_str(username, password):25 """Returns a Basic Auth string."""2627 return 'Basic ' + b64encode(('%s:%s' % (username, password)).encode('latin1')).strip().decode('latin1')
153 unmodified lines