Skip to content

Commit 545f832

Browse files
committed
import parse_qs from cgi if it can't be imported from urlparse, thus regaining compatibility with Python 2.5
fixes joestump#47 thanks to @vtsao, @subsume, @worksology
1 parent 25fbc2d commit 545f832

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

oauth2/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
import binascii
3232
import httplib2
3333

34-
from urlparse import parse_qs
34+
try:
35+
from urlparse import parse_qs
36+
parse_qs # placate pyflakes
37+
except ImportError:
38+
# fall back for Python 2.5
39+
from cgi import parse_qs
3540

3641
try:
3742
from hashlib import sha1

0 commit comments

Comments
 (0)