aboutsummaryrefslogtreecommitdiff
blob: 68318320b909998329a9dad5bc4c1077dc317cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
https://github.com/protocolbuffers/protobuf/issues/6205
https://github.com/protocolbuffers/protobuf/pull/7016

--- /python/google/protobuf/pyext/unknown_fields.cc
+++ /python/google/protobuf/pyext/unknown_fields.cc
@@ -277,13 +277,13 @@
   PyObject* data = NULL;
   switch (field->type()) {
     case UnknownField::TYPE_VARINT:
-      data = PyInt_FromLong(field->varint());
+      data = PyLong_FromUnsignedLongLong(field->varint());
       break;
     case UnknownField::TYPE_FIXED32:
-      data = PyInt_FromLong(field->fixed32());
+      data = PyLong_FromUnsignedLong(field->fixed32());
       break;
     case UnknownField::TYPE_FIXED64:
-      data = PyInt_FromLong(field->fixed64());
+      data = PyLong_FromUnsignedLongLong(field->fixed64());
       break;
     case UnknownField::TYPE_LENGTH_DELIMITED:
       data = PyBytes_FromStringAndSize(field->length_delimited().data(),