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:24:25 -0800 |
commit | f096f540eeb057103eb5c2330a4165e0aa251ff1 (patch) | |
tree | 1c1e2ce9b845f47002a3f3f60ba2cf2e96dda8f5 | |
parent | 7ba3527ffe6900a3c68059eec2220a17f6bd819c (diff) |
Recover 'namespace'd Python distribution packages
Uses dynamic loading to paper-over the negative effects of losing
namespace packages in the previous commit.
-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 d4e3152c59..f801dd632a 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 @@ -1293,3 +1294,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 |