summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-08-13 18:15:19 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-08-13 18:15:19 (GMT)
commit3c7e928098d874d82f1069fca640d20afca84c02 (patch)
treeffa38bccd38c29217f7f37656b0a9a523c4bd46c /Modules/_pickle.c
parent780199e6a367a98e98ff69750ad24916a0888b9f (diff)
downloadcpython-3c7e928098d874d82f1069fca640d20afca84c02.zip
cpython-3c7e928098d874d82f1069fca640d20afca84c02.tar.gz
cpython-3c7e928098d874d82f1069fca640d20afca84c02.tar.bz2
Issue #12744: Fix inefficient representation of integers
between 2**31 and 2**63 on systems with a 64-bit C "long".
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index f147e3e..5952c1b 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1540,7 +1540,7 @@ save_long(PicklerObject *self, PyObject *obj)
/* out of range for int pickling */
PyErr_Clear();
}
- else
+ else if (val <= 0x7fffffffL && val >= -0x80000000L)
return save_int(self, val);
if (self->proto >= 2) {