322c322 < element = PyInt_FromLong((long)(self->state[i])); --- > element = PyLong_FromUnsignedLong((self->state[i])); 342c342 < long element; --- > unsigned long element; 356,357c356,364 < element = PyInt_AsLong(PyTuple_GET_ITEM(state, i)); < if (element == -1 && PyErr_Occurred()) --- > element = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(state, i)); > #if SIZEOF_LONG == 4 > /* backward compatibility for old pickles with negative values */ > if ((long)element == -1 && PyErr_Occurred()) { > PyErr_Clear(); > element = (unsigned long) PyInt_AsLong(PyTuple_GET_ITEM(state, i)); > } > #endif > if ((long)element == -1 && PyErr_Occurred()) 359c366 < self->state[i] = (unsigned long)element; --- > self->state[i] = element;