From e779b9d90aa8f8df7117c0f1870a158d54ab8d95 Mon Sep 17 00:00:00 2001 From: Eric Salo Date: Tue, 27 Sep 2022 18:02:21 -0700 Subject: [PATCH] silently succeed when adding the same serialized file in Python PiperOrigin-RevId: 477321377 --- python/descriptor_pool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/descriptor_pool.c b/python/descriptor_pool.c index 4e9faaad2f..073fbdaf28 100644 --- a/python/descriptor_pool.c +++ b/python/descriptor_pool.c @@ -218,8 +218,7 @@ static PyObject* PyUpb_DescriptorPool_DoAddSerializedFile( } const upb_MessageDef* m = PyUpb_DescriptorPool_GetFileProtoDef(); if (upb_Message_IsEqual(proto, existing, m)) { - Py_INCREF(Py_None); - result = Py_None; + result = PyUpb_FileDescriptor_Get(file); goto done; } }