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

Skip to content

Commit b939a7d

Browse files
committed
Fix an issue with aliasing apiclient submodules.
The aliasing of `googleapiclient` as `apiclient` doesn't play nicely with imports of the form `from apiclient import foo`. This is far from the most elegant fix, but it gets the job done.
1 parent 0bf61f2 commit b939a7d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

apiclient/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,18 @@
2323
from googleapiclient import schema
2424

2525
__version__ = googleapiclient.__version__
26+
27+
_SUBMODULES = {
28+
'channel': channel,
29+
'discovery': discovery,
30+
'errors': errors,
31+
'http': http,
32+
'mimeparse': mimeparse,
33+
'model': model,
34+
'sample_tools': sample_tools,
35+
'schema': schema,
36+
}
37+
38+
import sys
39+
for module_name, module in _SUBMODULES.iteritems():
40+
sys.modules['apiclient.%s' % module_name] = module

0 commit comments

Comments
 (0)