Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f99fa88

Browse files
Merge pull request googleapis#201 from toabctl/support-oauth2client-v1-and-v2
Allow using oauth2client versions < 2.
2 parents a9bfae8 + bb32462 commit f99fa88

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

googleapiclient/discovery_cache/file_cache.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
import tempfile
3030
import threading
3131

32-
from oauth2client.contrib.locked_file import LockedFile
32+
try:
33+
from oauth2client.contrib.locked_file import LockedFile
34+
except ImportError:
35+
# oauth2client < 2.0.0
36+
from oauth2client.locked_file import LockedFile
3337

3438
from . import base
3539
from ..discovery_cache import DISCOVERY_DOC_MAX_AGE

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _DetectBadness():
6464

6565
install_requires = [
6666
'httplib2>=0.8,<1',
67-
'oauth2client>=2.0.0,<3',
67+
'oauth2client',
6868
'six>=1.6.1,<2',
6969
'uritemplate>=0.6,<1',
7070
]

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
[tox]
2-
envlist = py26, py27, py33, py34
2+
envlist = py{26,27,33,34}-oauth2client{1,2}
33

44
[testenv]
5-
deps = keyring
5+
deps =
6+
oauth2client1: oauth2client<2
7+
oauth2client2: oauth2client>=2,<=3
8+
keyring
69
mox
710
pyopenssl
811
pycrypto==2.6

0 commit comments

Comments
 (0)