Skip to content

Commit

Permalink
Add patch to protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
gnossen committed Jan 14, 2021
1 parent 0cdbad9 commit 99d20df
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bazel/grpc_deps.bzl
Expand Up @@ -175,6 +175,8 @@ def grpc_deps():
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/protobuf/archive/19fb89416f3fdc2d6668f3738f444885575285bc.tar.gz",
"https://github.com/google/protobuf/archive/19fb89416f3fdc2d6668f3738f444885575285bc.tar.gz",
],
patches = ["//third_party:protobuf.patch"],
patch_args = ["-p1"],
)

if "com_google_googletest" not in native.existing_rules():
Expand Down
14 changes: 14 additions & 0 deletions third_party/protobuf.patch
@@ -0,0 +1,14 @@
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py
index 97ac28028..8b7585d9d 100644
--- a/python/google/protobuf/__init__.py
+++ b/python/google/protobuf/__init__.py
@@ -31,3 +31,9 @@
# Copyright 2007 Google Inc. All Rights Reserved.

__version__ = '3.14.0'
+
+if __name__ != '__main__':
+ try:
+ __import__('pkg_resources').declare_namespace(__name__)
+ except ImportError:
+ __path__ = __import__('pkgutil').extend_path(__path__, __name__)

0 comments on commit 99d20df

Please sign in to comment.