From d6c4df0c6f4b7fe5376f0a841b6714a4c3d449aa Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 9 Apr 2019 08:53:27 -0700 Subject: [PATCH] Remove namespace package boilerplate from google.protobuf and google.protobuf.pyext. setup.py does not declare these packages to be namespace packages, so they shouldn't have the boilerplate. Fixes https://github.com/protocolbuffers/protobuf/issues/5194. --- python/google/protobuf/__init__.py | 6 ------ python/google/protobuf/pyext/__init__.py | 4 ---- 2 files changed, 10 deletions(-) diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 5a025af1a656..f68ff8e00e5c 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -31,9 +31,3 @@ # Copyright 2007 Google Inc. All Rights Reserved. __version__ = '3.11.0rc0' - -if __name__ != '__main__': - try: - __import__('pkg_resources').declare_namespace(__name__) - except ImportError: - __path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/python/google/protobuf/pyext/__init__.py b/python/google/protobuf/pyext/__init__.py index 558561412299..e69de29bb2d1 100644 --- a/python/google/protobuf/pyext/__init__.py +++ b/python/google/protobuf/pyext/__init__.py @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - __path__ = __import__('pkgutil').extend_path(__path__, __name__)