]> jfr.im git - z_archive/twitter.git/commitdiff
uniformize python3 checker
authorRouxRC <redacted>
Wed, 24 Dec 2014 05:33:28 +0000 (06:33 +0100)
committerRouxRC <redacted>
Wed, 24 Dec 2014 05:33:28 +0000 (06:33 +0100)
twitter/oauth.py

index d43f753d572565900ca4eb51efd6b4bfd2b8fc43..2df5ff0a1eb9a0319d6ad959ac21702d2edd05de 100644 (file)
@@ -42,10 +42,9 @@ code it all goes like this::
 from __future__ import print_function
 
 from random import getrandbits
-import sys
 from time import time
 
-PY3 = sys.version_info[0] == 3
+from .util import PY_3_OR_HIGHER
 
 try:
     import urllib.parse as urllib_parse
@@ -126,7 +125,7 @@ class OAuth(Auth):
 # So here is a specialized version which does exactly that.
 # In Python2, since there is no safe option for urlencode, we force it by hand
 def urlencode_noplus(query):
-    if not PY3:
+    if not PY_3_OR_HIGHER:
         new_query = []
         TILDE = '____TILDE-PYTHON-TWITTER____'
         for k,v in query: