diff options
author | Masood Malekghassemi <atash@google.com> | 2016-12-12 15:34:34 -0800 |
---|---|---|
committer | Masood Malekghassemi <atash@google.com> | 2016-12-12 16:23:33 -0800 |
commit | 53f6d098a7d79325005be594b17096ee0a82ae26 (patch) | |
tree | b21d64b1c03d7cafeeddc6a3b7fca1b7acbf7191 /src/python/grpcio/grpc/__init__.py | |
parent | fb261bf74803eace0b733cac934b1a4632f3cbfd (diff) |
Recover 'namespace'd Python distribution packages
Uses dynamic loading to paper-over the negative effects of losing
namespace packages in the previous commit.
Diffstat (limited to 'src/python/grpcio/grpc/__init__.py')
-rw-r--r-- | src/python/grpcio/grpc/__init__.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index cfad7de42f..3713c1fd44 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -31,6 +31,7 @@ import abc import enum +import sys import six @@ -1342,3 +1343,24 @@ __all__ = ( 'secure_channel', 'server', ) + + +############################### Extension Shims ################################ + + +# Here to maintain backwards compatibility; avoid using these in new code! +try: + import grpc_tools + sys.modules.update({'grpc.tools': grpc_tools}) +except ImportError: + pass +try: + import grpc_health + sys.modules.update({'grpc.health': grpc_health}) +except ImportError: + pass +try: + import grpc_reflection + sys.modules.update({'grpc.reflection': grpc_reflection}) +except ImportError: + pass |