Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions python/google/protobuf/pyext/descriptor_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ static PyDescriptorPool* PyDescriptorPool_NewWithUnderlay(
}

static PyDescriptorPool* PyDescriptorPool_NewWithDatabase(
DescriptorDatabase* database,
bool use_deprecated_legacy_json_field_conflicts) {
DescriptorDatabase* database) {
PyDescriptorPool* cpool = _CreateDescriptorPool();
if (cpool == nullptr) {
return nullptr;
Expand All @@ -164,11 +163,6 @@ static PyDescriptorPool* PyDescriptorPool_NewWithDatabase(
pool = new DescriptorPool();
cpool->is_mutable = true;
}
if (use_deprecated_legacy_json_field_conflicts) {
PROTOBUF_IGNORE_DEPRECATION_START
pool->UseDeprecatedLegacyJsonFieldConflicts();
PROTOBUF_IGNORE_DEPRECATION_STOP
}
cpool->pool = pool;
cpool->is_owned = true;

Expand All @@ -188,7 +182,6 @@ static PyDescriptorPool* PyDescriptorPool_NewWithDatabase(
// The public DescriptorPool constructor.
static PyObject* New(PyTypeObject* type,
PyObject* args, PyObject* kwargs) {
int use_deprecated_legacy_json_field_conflicts = 0;
static const char* kwlist[] = {"descriptor_db", nullptr};
PyObject* py_database = nullptr;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O",
Expand All @@ -200,7 +193,7 @@ static PyObject* New(PyTypeObject* type,
database = new PyDescriptorDatabase(py_database);
}
return reinterpret_cast<PyObject*>(PyDescriptorPool_NewWithDatabase(
database, use_deprecated_legacy_json_field_conflicts));
database));
}

static void Dealloc(PyObject* pself) {
Expand Down
6 changes: 0 additions & 6 deletions src/google/protobuf/descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2459,12 +2459,6 @@ class PROTOBUF_EXPORT DescriptorPool {
// Disallow [enforce_utf8 = false] in .proto files.
void DisallowEnforceUtf8() { disallow_enforce_utf8_ = true; }

// Use the deprecated legacy behavior for handling JSON field name conflicts.
ABSL_DEPRECATED("Deprecated treatment of field name conflicts is enabled.")
void UseDeprecatedLegacyJsonFieldConflicts() {
deprecated_legacy_json_field_conflicts_ = true;
}


// For internal use only: Gets a non-const pointer to the generated pool.
// This is called at static-initialization time only, so thread-safety is
Expand Down
Loading