Prevent import order issue in cyclic imports

pull/24341/head
Lidi Zheng 4 years ago
parent e54fe6ccd0
commit c6dc383c15
  1. 3
      src/python/grpcio/grpc/__init__.py

@ -2124,6 +2124,7 @@ try:
except ImportError:
pass
if sys.version_info >= (3, 6):
# The package check is necessary to prevent import order issue in cyclic import.
if sys.version_info >= (3, 6) and __package__ == "grpc":
from grpc import aio # pylint: disable=ungrouped-imports
sys.modules.update({'grpc.aio': aio})

Loading…
Cancel
Save