Mercurial > cpython-lru_cache-weakref
comparison Python/ast.c @ 42736:ddefbdbdbcb5 2.5
Backport fix of #1752175.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Thu, 23 Aug 2007 18:08:33 +0000 |
| parents | c2ac22c6f98d |
| children | 275115999b58 |
comparison
equal
deleted
inserted
replaced
| 42733:bcbdc95dfba9 | 42736:ddefbdbdbcb5 |
|---|---|
| 3113 Py_DECREF(u); | 3113 Py_DECREF(u); |
| 3114 return v; | 3114 return v; |
| 3115 #endif | 3115 #endif |
| 3116 } | 3116 } |
| 3117 | 3117 |
| 3118 #ifdef Py_USING_UNICODE | |
| 3118 static PyObject * | 3119 static PyObject * |
| 3119 decode_unicode(const char *s, size_t len, int rawmode, const char *encoding) | 3120 decode_unicode(const char *s, size_t len, int rawmode, const char *encoding) |
| 3120 { | 3121 { |
| 3121 PyObject *v, *u; | 3122 PyObject *v, *u; |
| 3122 char *buf; | 3123 char *buf; |
| 3174 else | 3175 else |
| 3175 v = PyUnicode_DecodeUnicodeEscape(s, len, NULL); | 3176 v = PyUnicode_DecodeUnicodeEscape(s, len, NULL); |
| 3176 Py_XDECREF(u); | 3177 Py_XDECREF(u); |
| 3177 return v; | 3178 return v; |
| 3178 } | 3179 } |
| 3180 #endif | |
| 3179 | 3181 |
| 3180 /* s is a Python string literal, including the bracketing quote characters, | 3182 /* s is a Python string literal, including the bracketing quote characters, |
| 3181 * and r &/or u prefixes (if any), and embedded escape sequences (if any). | 3183 * and r &/or u prefixes (if any), and embedded escape sequences (if any). |
| 3182 * parsestr parses it, and returns the decoded Python string object. | 3184 * parsestr parses it, and returns the decoded Python string object. |
| 3183 */ | 3185 */ |
