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