Mercurial > cpython-lru_cache-weakref
comparison Python/codecs.c @ 73358:2df7d749ee3a
PyCodec_XMLCharRefReplaceError(): Remove unused variable
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Fri, 04 Nov 2011 21:29:10 +0100 |
| parents | 2bec7c452b39 |
| children | e3b6458056c7 |
comparison
equal
deleted
inserted
replaced
| 73356:b3543ef9b445 | 73358:2df7d749ee3a |
|---|---|
| 571 PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc) | 571 PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc) |
| 572 { | 572 { |
| 573 if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) { | 573 if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) { |
| 574 PyObject *restuple; | 574 PyObject *restuple; |
| 575 PyObject *object; | 575 PyObject *object; |
| 576 Py_ssize_t i, o; | 576 Py_ssize_t i; |
| 577 Py_ssize_t start; | 577 Py_ssize_t start; |
| 578 Py_ssize_t end; | 578 Py_ssize_t end; |
| 579 PyObject *res; | 579 PyObject *res; |
| 580 unsigned char *outp; | 580 unsigned char *outp; |
| 581 int ressize; | 581 int ressize; |
| 610 Py_DECREF(object); | 610 Py_DECREF(object); |
| 611 return NULL; | 611 return NULL; |
| 612 } | 612 } |
| 613 outp = PyUnicode_1BYTE_DATA(res); | 613 outp = PyUnicode_1BYTE_DATA(res); |
| 614 /* generate replacement */ | 614 /* generate replacement */ |
| 615 for (i = start, o = 0; i < end; ++i) { | 615 for (i = start; i < end; ++i) { |
| 616 int digits; | 616 int digits; |
| 617 int base; | 617 int base; |
| 618 ch = PyUnicode_READ_CHAR(object, i); | 618 ch = PyUnicode_READ_CHAR(object, i); |
| 619 *outp++ = '&'; | 619 *outp++ = '&'; |
| 620 *outp++ = '#'; | 620 *outp++ = '#'; |
