]> jfr.im git - z_archive/twitter.git/commit
Use Six's method to determine when running under Python 3.
authorBen Sturmfels <redacted>
Sat, 29 Nov 2014 23:52:11 +0000 (10:52 +1100)
committerBen Sturmfels <redacted>
Sat, 29 Nov 2014 23:52:11 +0000 (10:52 +1100)
commit4073437dcfb65d0a23696d92688cb00fcadcb37d
treed8bf4c3e89d6768d92c1b59b5bbd2568ddd143fb
parent3bbccc7d34a63fe2934ef6c48fac7a96b1149f67
Use Six's method to determine when running under Python 3.

oauth.py guesses whether it is running under Python 3 by the existance of urllib.parse.urllib_parse and urllib.parse.urlencode. The code then uses urlencode's safe parameter if it believes it's running under Python 3. Unfortunately the guess fails when using Future, a library for writing clean Python 3 code that is backwards compatible with Python 2, since Future manipulates some builtins.

This change applies the version test that isn't confused by the use of Futures. It's the same test used by the Six library.
twitter/oauth.py