Mercurial > cpython-lru_cache-weakref
comparison Python/Python-ast.c @ 73701:53cc2668d54f
Merge branch 3.2
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> |
|---|---|
| date | Tue, 22 Nov 2011 22:02:01 +0100 |
| parents | db4aa878cea2 470f7d7c57ce |
| children | d64ac9ab4cd0 |
comparison
equal
deleted
inserted
replaced
| 73697:77ab830930ae | 73701:53cc2668d54f |
|---|---|
| 688 | 688 |
| 689 static int obj2ast_int(PyObject* obj, int* out, PyArena* arena) | 689 static int obj2ast_int(PyObject* obj, int* out, PyArena* arena) |
| 690 { | 690 { |
| 691 int i; | 691 int i; |
| 692 if (!PyLong_Check(obj)) { | 692 if (!PyLong_Check(obj)) { |
| 693 PyObject *s = PyObject_Repr(obj); | 693 PyErr_Format(PyExc_ValueError, "invalid integer value: %R", obj); |
| 694 if (s == NULL) return 1; | |
| 695 PyErr_Format(PyExc_ValueError, "invalid integer value: %.400s", | |
| 696 PyBytes_AS_STRING(s)); | |
| 697 Py_DECREF(s); | |
| 698 return 1; | 694 return 1; |
| 699 } | 695 } |
| 700 | 696 |
| 701 i = (int)PyLong_AsLong(obj); | 697 i = (int)PyLong_AsLong(obj); |
| 702 if (i == -1 && PyErr_Occurred()) | 698 if (i == -1 && PyErr_Occurred()) |
