Skip to content

Commit 5359959

Browse files
committed
make oauth2.__version__ exist, rename VERSION to OAUTH_VERSION for clarity
1 parent 068777b commit 5359959

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

oauth2/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
from cgi import parse_qs, parse_qsl
3737

3838

39-
VERSION = '1.0' # Hi Blaine!
39+
import _version
40+
41+
__version__ = _version.__version__
42+
43+
OAUTH_VERSION = '1.0' # Hi Blaine!
4044
HTTP_METHOD = 'GET'
4145
SIGNATURE_METHOD = 'PLAINTEXT'
4246

@@ -266,7 +270,7 @@ class Request(dict):
266270
267271
"""
268272

269-
version = VERSION
273+
version = OAUTH_VERSION
270274

271275
def __init__(self, method=HTTP_METHOD, url=None, parameters=None):
272276
self.method = method
@@ -585,7 +589,7 @@ class Server(object):
585589
"""
586590

587591
timestamp_threshold = 300 # In seconds, five minutes.
588-
version = VERSION
592+
version = OAUTH_VERSION
589593
signature_methods = None
590594

591595
def __init__(self, signature_methods=None):
@@ -612,7 +616,7 @@ def _get_version(self, request):
612616
try:
613617
version = request.get_parameter('oauth_version')
614618
except:
615-
version = VERSION
619+
version = OAUTH_VERSION
616620

617621
if version and version != self.version:
618622
raise Error('OAuth version %s not supported.' % str(version))

0 commit comments

Comments
 (0)