Merge pull request #491 from haberman/python-enummap

Fixed a bug in the enum value map, fixing a few unit tests.
pull/13171/head
Joshua Haberman 3 years ago committed by GitHub
commit 878e4f7457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      python/descriptor.c
  2. 2
      python/pb_unit_tests/descriptor_test_wrapper.py

@ -533,7 +533,7 @@ static PyObject* PyUpb_Descriptor_GetEnumValuesByName(PyObject* _self,
// bang for the buck.
const upb_EnumValueDef* ev = upb_EnumDef_Value(e, j);
const char* name = upb_EnumValueDef_Name(ev);
PyObject* val = PyLong_FromLong(upb_EnumValueDef_Number(ev));
PyObject* val = PyUpb_EnumValueDescriptor_Get(ev);
if (!val || PyDict_SetItemString(ret, name, val) < 0) {
Py_XDECREF(val);
Py_DECREF(ret);

@ -31,8 +31,6 @@ descriptor_test.GeneratedDescriptorTest.testDescriptor.__unittest_expecting_fail
descriptor_test.MakeDescriptorTest.testCamelcaseName.__unittest_expecting_failure__ = True
descriptor_test.MakeDescriptorTest.testJsonName.__unittest_expecting_failure__ = True
descriptor_test.NewDescriptorTest.testImmutableCppDescriptor.__unittest_expecting_failure__ = True
descriptor_test.NewDescriptorTest.testNestedOptions.__unittest_expecting_failure__ = True
descriptor_test.NewDescriptorTest.testSimpleCustomOptions.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=descriptor_test, verbosity=2)

Loading…
Cancel
Save