diff --git a/aea/__init__.py b/aea/__init__.py index 79530569bb..0a2d09a20b 100644 --- a/aea/__init__.py +++ b/aea/__init__.py @@ -20,6 +20,21 @@ """Contains the AEA package.""" +# pylint: disable=wrong-import-position + +import sys + + +# Patch to fix https://github.com/protocolbuffers/protobuf/issues/3276 + +_google_upb_message = sys.modules.pop("google._upb._message", None) + +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +if _google_upb_message is not None: + sys.modules["google._upb._message"] = _google_upb_message + import inspect import os diff --git a/aea/cli/__init__.py b/aea/cli/__init__.py index e91838a11e..5a3d89bec2 100644 --- a/aea/cli/__init__.py +++ b/aea/cli/__init__.py @@ -20,19 +20,5 @@ """This module contains the implementation of command-line tool 'aea'.""" -# pylint: disable=wrong-import-position - -import sys - - -# Patch to fix https://github.com/protocolbuffers/protobuf/issues/3276 - -_google_upb_message = sys.modules.pop("google._upb._message", None) - -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -if _google_upb_message is not None: - sys.modules["google._upb._message"] = _google_upb_message from .core import cli