Internal change only
PiperOrigin-RevId: 491993057
diff --git a/python/google/protobuf/descriptor.py b/python/google/protobuf/descriptor.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/internal/api_implementation.py b/python/google/protobuf/internal/api_implementation.py
old mode 100644
new mode 100755
index 3b81f27..1c84621
--- a/python/google/protobuf/internal/api_implementation.py
+++ b/python/google/protobuf/internal/api_implementation.py
@@ -102,6 +102,7 @@
try:
# pylint: disable=g-import-not-at-top
from google.protobuf.pyext import _message
+ sys.modules['google.protobuf.internal.cpp._message'] = _message
_c_module = _message
del _message
except ImportError:
@@ -151,6 +152,12 @@
return _implementation_type
+def _SetType(implementation_type):
+ """Never use! Only for protobuf benchmark."""
+ global _implementation_type
+ _implementation_type = implementation_type
+
+
# See comment on 'Type' above.
# TODO(jieluo): Remove the API, it returns a constant. b/228102101
def Version():
diff --git a/python/google/protobuf/internal/containers.py b/python/google/protobuf/internal/containers.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/internal/decoder.py b/python/google/protobuf/internal/decoder.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/internal/encoder.py b/python/google/protobuf/internal/encoder.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/internal/python_message.py b/python/google/protobuf/internal/python_message.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/internal/python_protobuf.cc b/python/google/protobuf/internal/python_protobuf.cc
index 95c6d2b..9e894de 100644
--- a/python/google/protobuf/internal/python_protobuf.cc
+++ b/python/google/protobuf/internal/python_protobuf.cc
@@ -30,7 +30,7 @@
// Author: qrczak@google.com (Marcin Kowalczyk)
-#include "google/protobuf/python/python_protobuf.h"
+#include "third_party/py/google/protobuf/python_protobuf.h"
namespace google {
namespace protobuf {
diff --git a/python/google/protobuf/internal/test_util.py b/python/google/protobuf/internal/test_util.py
old mode 100644
new mode 100755
index 4342eb5..32fb8fd
--- a/python/google/protobuf/internal/test_util.py
+++ b/python/google/protobuf/internal/test_util.py
@@ -49,12 +49,11 @@
long = int # Python 3
-# Tests whether the given TestAllTypes message is
-# protobuf_unittest.TestAllTypes or not.
+# Tests whether the given TestAllTypes message is proto2 or not.
# This is used to gate several fields/features that only exist
-# for the protobuf_unittest version of the message.
+# for the proto2 version of the message.
def IsProto2(message):
- return message.DESCRIPTOR.full_name == 'protobuf_unittest.TestAllTypes'
+ return message.DESCRIPTOR.syntax == "proto2"
def SetAllNonLazyFields(message):
diff --git a/python/google/protobuf/internal/type_checkers.py b/python/google/protobuf/internal/type_checkers.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/message.py b/python/google/protobuf/message.py
old mode 100644
new mode 100755
diff --git a/python/google/protobuf/proto_api.h b/python/google/protobuf/proto_api.h
index 4e910e0..753b057 100644
--- a/python/google/protobuf/proto_api.h
+++ b/python/google/protobuf/proto_api.h
@@ -42,8 +42,8 @@
// Then use the methods of the returned class:
// py_proto_api->GetMessagePointer(...);
-#ifndef GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
-#define GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -141,4 +141,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc
index f6db77a..fd0298b 100644
--- a/python/google/protobuf/pyext/descriptor.cc
+++ b/python/google/protobuf/pyext/descriptor.cc
@@ -30,7 +30,7 @@
// Author: petar@google.com (Petar Petrov)
-#include "google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -42,11 +42,11 @@
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/dynamic_message.h"
-#include "google/protobuf/pyext/descriptor_containers.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_containers.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/io/coded_stream.h"
diff --git a/python/google/protobuf/pyext/descriptor.h b/python/google/protobuf/pyext/descriptor.h
index 8559c66..8d2899f 100644
--- a/python/google/protobuf/pyext/descriptor.h
+++ b/python/google/protobuf/pyext/descriptor.h
@@ -30,8 +30,8 @@
// Author: petar@google.com (Petar Petrov)
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -102,4 +102,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
diff --git a/python/google/protobuf/pyext/descriptor_containers.cc b/python/google/protobuf/pyext/descriptor_containers.cc
index f38fdc7..6e72a7d 100644
--- a/python/google/protobuf/pyext/descriptor_containers.cc
+++ b/python/google/protobuf/pyext/descriptor_containers.cc
@@ -56,13 +56,13 @@
#include <string>
-#include "google/protobuf/pyext/descriptor_containers.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_containers.h"
// clang-format on
#include "google/protobuf/descriptor.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
diff --git a/python/google/protobuf/pyext/descriptor_containers.h b/python/google/protobuf/pyext/descriptor_containers.h
index cf2cf4a..8443c0f 100644
--- a/python/google/protobuf/pyext/descriptor_containers.h
+++ b/python/google/protobuf/pyext/descriptor_containers.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
// Mappings and Sequences of descriptors.
// They implement containers like fields_by_name, EnumDescriptor.values...
@@ -107,4 +107,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
diff --git a/python/google/protobuf/pyext/descriptor_database.cc b/python/google/protobuf/pyext/descriptor_database.cc
index e547306..836d930 100644
--- a/python/google/protobuf/pyext/descriptor_database.cc
+++ b/python/google/protobuf/pyext/descriptor_database.cc
@@ -31,7 +31,7 @@
// This file defines a C++ DescriptorDatabase, which wraps a Python Database
// and delegate all its operations to Python methods.
-#include "google/protobuf/pyext/descriptor_database.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_database.h"
#include <cstdint>
#include <string>
@@ -40,8 +40,8 @@
#include "google/protobuf/stubs/logging.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/descriptor.pb.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
namespace google {
namespace protobuf {
diff --git a/python/google/protobuf/pyext/descriptor_database.h b/python/google/protobuf/pyext/descriptor_database.h
index 108a858..2874b9d 100644
--- a/python/google/protobuf/pyext/descriptor_database.h
+++ b/python/google/protobuf/pyext/descriptor_database.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -83,4 +83,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
diff --git a/python/google/protobuf/pyext/descriptor_pool.cc b/python/google/protobuf/pyext/descriptor_pool.cc
index db14ae6..771a481 100644
--- a/python/google/protobuf/pyext/descriptor_pool.cc
+++ b/python/google/protobuf/pyext/descriptor_pool.cc
@@ -39,13 +39,14 @@
#include <Python.h>
#include "google/protobuf/descriptor.pb.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/descriptor_database.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_database.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
+#include "absl/strings/str_replace.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
(PyUnicode_Check(ob) \
diff --git a/python/google/protobuf/pyext/descriptor_pool.h b/python/google/protobuf/pyext/descriptor_pool.h
index 851cf31..9ce2ccd 100644
--- a/python/google/protobuf/pyext/descriptor_pool.h
+++ b/python/google/protobuf/pyext/descriptor_pool.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -146,4 +146,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
diff --git a/python/google/protobuf/pyext/extension_dict.cc b/python/google/protobuf/pyext/extension_dict.cc
index 806af4f..78d521e 100644
--- a/python/google/protobuf/pyext/extension_dict.cc
+++ b/python/google/protobuf/pyext/extension_dict.cc
@@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#include "google/protobuf/pyext/extension_dict.h"
+#include "third_party/py/google/protobuf/pyext/extension_dict.h"
#include <cstdint>
#include <memory>
@@ -43,12 +43,12 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/message.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/repeated_composite_container.h"
-#include "google/protobuf/pyext/repeated_scalar_container.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
+#include "third_party/py/google/protobuf/pyext/repeated_scalar_container.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
diff --git a/python/google/protobuf/pyext/extension_dict.h b/python/google/protobuf/pyext/extension_dict.h
index c5c2875..2e52352 100644
--- a/python/google/protobuf/pyext/extension_dict.h
+++ b/python/google/protobuf/pyext/extension_dict.h
@@ -31,13 +31,13 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@@ -67,4 +67,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
diff --git a/python/google/protobuf/pyext/field.cc b/python/google/protobuf/pyext/field.cc
index daa95d0..b4d0055 100644
--- a/python/google/protobuf/pyext/field.cc
+++ b/python/google/protobuf/pyext/field.cc
@@ -28,11 +28,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "google/protobuf/pyext/field.h"
+#include "third_party/py/google/protobuf/pyext/field.h"
#include "google/protobuf/descriptor.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
diff --git a/python/google/protobuf/pyext/field.h b/python/google/protobuf/pyext/field.h
index f9f94c4..86d20e6 100644
--- a/python/google/protobuf/pyext/field.h
+++ b/python/google/protobuf/pyext/field.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -57,4 +57,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
diff --git a/python/google/protobuf/pyext/map_container.cc b/python/google/protobuf/pyext/map_container.cc
index 76c4d88..911d0b7 100644
--- a/python/google/protobuf/pyext/map_container.cc
+++ b/python/google/protobuf/pyext/map_container.cc
@@ -30,7 +30,7 @@
// Author: haberman@google.com (Josh Haberman)
-#include "google/protobuf/pyext/map_container.h"
+#include "third_party/py/google/protobuf/pyext/map_container.h"
#include <cstdint>
#include <memory>
@@ -41,10 +41,10 @@
#include "google/protobuf/map.h"
#include "google/protobuf/map_field.h"
#include "google/protobuf/message.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/repeated_composite_container.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
namespace google {
namespace protobuf {
diff --git a/python/google/protobuf/pyext/map_container.h b/python/google/protobuf/pyext/map_container.h
index d90d3a5..1c18e12 100644
--- a/python/google/protobuf/pyext/map_container.h
+++ b/python/google/protobuf/pyext/map_container.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -38,7 +38,7 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/message.h"
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@@ -86,4 +86,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index 108dd52..ccd012f 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
#include <structmember.h> // A Python header file.
@@ -57,18 +57,18 @@
#include "google/protobuf/message.h"
#include "google/protobuf/text_format.h"
#include "google/protobuf/unknown_field_set.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/extension_dict.h"
-#include "google/protobuf/pyext/field.h"
-#include "google/protobuf/pyext/map_container.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/repeated_composite_container.h"
-#include "google/protobuf/pyext/repeated_scalar_container.h"
-#include "google/protobuf/pyext/safe_numerics.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
-#include "google/protobuf/pyext/unknown_field_set.h"
-#include "google/protobuf/pyext/unknown_fields.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/extension_dict.h"
+#include "third_party/py/google/protobuf/pyext/field.h"
+#include "third_party/py/google/protobuf/pyext/map_container.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
+#include "third_party/py/google/protobuf/pyext/repeated_scalar_container.h"
+#include "third_party/py/google/protobuf/pyext/safe_numerics.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/unknown_field_set.h"
+#include "third_party/py/google/protobuf/pyext/unknown_fields.h"
#include "google/protobuf/util/message_differencer.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/io/coded_stream.h"
diff --git a/python/google/protobuf/pyext/message.h b/python/google/protobuf/pyext/message.h
index 1b0172f..f681714 100644
--- a/python/google/protobuf/pyext/message.h
+++ b/python/google/protobuf/pyext/message.h
@@ -31,8 +31,8 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -374,4 +374,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
diff --git a/python/google/protobuf/pyext/message_factory.cc b/python/google/protobuf/pyext/message_factory.cc
index 27aa5e4..6571004 100644
--- a/python/google/protobuf/pyext/message_factory.cc
+++ b/python/google/protobuf/pyext/message_factory.cc
@@ -35,10 +35,10 @@
#include <Python.h>
#include "google/protobuf/dynamic_message.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
(PyUnicode_Check(ob) \
diff --git a/python/google/protobuf/pyext/message_factory.h b/python/google/protobuf/pyext/message_factory.h
index 1d911a8..0c8bcdf 100644
--- a/python/google/protobuf/pyext/message_factory.h
+++ b/python/google/protobuf/pyext/message_factory.h
@@ -28,15 +28,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <unordered_map>
#include "google/protobuf/descriptor.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
namespace google {
namespace protobuf {
@@ -101,4 +101,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
diff --git a/python/google/protobuf/pyext/message_module.cc b/python/google/protobuf/pyext/message_module.cc
index f469206..d8ed315 100644
--- a/python/google/protobuf/pyext/message_module.cc
+++ b/python/google/protobuf/pyext/message_module.cc
@@ -32,11 +32,11 @@
#include <Python.h>
#include "google/protobuf/message_lite.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/proto_api.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/proto_api.h"
namespace {
diff --git a/python/google/protobuf/pyext/repeated_composite_container.cc b/python/google/protobuf/pyext/repeated_composite_container.cc
index a191670..8ec6881 100644
--- a/python/google/protobuf/pyext/repeated_composite_container.cc
+++ b/python/google/protobuf/pyext/repeated_composite_container.cc
@@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#include "google/protobuf/pyext/repeated_composite_container.h"
+#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
#include <memory>
@@ -41,11 +41,11 @@
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/message.h"
#include "google/protobuf/reflection.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/message_factory.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message_factory.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
namespace google {
namespace protobuf {
diff --git a/python/google/protobuf/pyext/repeated_composite_container.h b/python/google/protobuf/pyext/repeated_composite_container.h
index 8964374..044285b 100644
--- a/python/google/protobuf/pyext/repeated_composite_container.h
+++ b/python/google/protobuf/pyext/repeated_composite_container.h
@@ -31,13 +31,13 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@@ -106,4 +106,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
diff --git a/python/google/protobuf/pyext/repeated_scalar_container.cc b/python/google/protobuf/pyext/repeated_scalar_container.cc
index 57746dc..cc3a311 100644
--- a/python/google/protobuf/pyext/repeated_scalar_container.cc
+++ b/python/google/protobuf/pyext/repeated_scalar_container.cc
@@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#include "google/protobuf/pyext/repeated_scalar_container.h"
+#include "third_party/py/google/protobuf/pyext/repeated_scalar_container.h"
#include <cstdint>
#include <memory>
@@ -42,10 +42,10 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/message.h"
-#include "google/protobuf/pyext/descriptor.h"
-#include "google/protobuf/pyext/descriptor_pool.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/descriptor.h"
+#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#define PyString_AsString(ob) \
(PyUnicode_Check(ob) ? PyUnicode_AsUTF8(ob) : PyBytes_AsString(ob))
diff --git a/python/google/protobuf/pyext/repeated_scalar_container.h b/python/google/protobuf/pyext/repeated_scalar_container.h
index 0189886..fafead4 100644
--- a/python/google/protobuf/pyext/repeated_scalar_container.h
+++ b/python/google/protobuf/pyext/repeated_scalar_container.h
@@ -31,14 +31,14 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "google/protobuf/descriptor.h"
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@@ -73,4 +73,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
diff --git a/python/google/protobuf/pyext/safe_numerics.h b/python/google/protobuf/pyext/safe_numerics.h
index 0d4dd25..5686fbe 100644
--- a/python/google/protobuf/pyext/safe_numerics.h
+++ b/python/google/protobuf/pyext/safe_numerics.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
// Copied from chromium with only changes to the namespace.
#include <limits>
@@ -161,4 +161,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
diff --git a/python/google/protobuf/pyext/scoped_pyobject_ptr.h b/python/google/protobuf/pyext/scoped_pyobject_ptr.h
index d39a4d1..4ca7258 100644
--- a/python/google/protobuf/pyext/scoped_pyobject_ptr.h
+++ b/python/google/protobuf/pyext/scoped_pyobject_ptr.h
@@ -30,8 +30,8 @@
// Author: tibell@google.com (Johan Tibell)
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -96,4 +96,4 @@
} // namespace python
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
diff --git a/python/google/protobuf/pyext/unknown_field_set.cc b/python/google/protobuf/pyext/unknown_field_set.cc
index 59d1d0b..7ca0890 100644
--- a/python/google/protobuf/pyext/unknown_field_set.cc
+++ b/python/google/protobuf/pyext/unknown_field_set.cc
@@ -28,7 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "google/protobuf/pyext/unknown_field_set.h"
+#include "third_party/py/google/protobuf/pyext/unknown_field_set.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -38,8 +38,8 @@
#include "google/protobuf/message.h"
#include "google/protobuf/unknown_field_set.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "google/protobuf/wire_format_lite.h"
namespace google {
diff --git a/python/google/protobuf/pyext/unknown_field_set.h b/python/google/protobuf/pyext/unknown_field_set.h
index 92a889d..4637688 100644
--- a/python/google/protobuf/pyext/unknown_field_set.h
+++ b/python/google/protobuf/pyext/unknown_field_set.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -37,7 +37,7 @@
#include <memory>
#include <set>
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@@ -75,4 +75,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
diff --git a/python/google/protobuf/pyext/unknown_fields.cc b/python/google/protobuf/pyext/unknown_fields.cc
index bb6549d..326f57c 100644
--- a/python/google/protobuf/pyext/unknown_fields.cc
+++ b/python/google/protobuf/pyext/unknown_fields.cc
@@ -28,7 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "google/protobuf/pyext/unknown_fields.h"
+#include "third_party/py/google/protobuf/pyext/unknown_fields.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -38,8 +38,8 @@
#include "google/protobuf/message.h"
#include "google/protobuf/unknown_field_set.h"
-#include "google/protobuf/pyext/message.h"
-#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "google/protobuf/wire_format_lite.h"
namespace google {
diff --git a/python/google/protobuf/pyext/unknown_fields.h b/python/google/protobuf/pyext/unknown_fields.h
index 81ee1a9..6e177fa 100644
--- a/python/google/protobuf/pyext/unknown_fields.h
+++ b/python/google/protobuf/pyext/unknown_fields.h
@@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
-#define GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -37,7 +37,7 @@
#include <memory>
#include <set>
-#include "google/protobuf/pyext/message.h"
+#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@@ -88,4 +88,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
diff --git a/python/google/protobuf/python_protobuf.h b/python/google/protobuf/python_protobuf.h
index 4fcf065..008b101 100644
--- a/python/google/protobuf/python_protobuf.h
+++ b/python/google/protobuf/python_protobuf.h
@@ -33,8 +33,8 @@
// This module exposes the C proto inside the given Python proto, in
// case the Python proto is implemented with a C proto.
-#ifndef GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
-#define GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
+#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
+#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -55,4 +55,4 @@
} // namespace protobuf
} // namespace google
-#endif // GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
+#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__