diff options
author | Guido van Rossum <guido@python.org> | 2001-10-25 18:07:22 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-10-25 18:07:22 (GMT) |
commit | 70e368836421a2e8c08dbd043a1540ad56d7ae5c (patch) | |
tree | b0322959776f5e9f158514cb4a2430e73ed72569 /Objects | |
parent | 847c51a1812962efe525a987e6ddf15563206e68 (diff) | |
download | cpython-70e368836421a2e8c08dbd043a1540ad56d7ae5c.zip cpython-70e368836421a2e8c08dbd043a1540ad56d7ae5c.tar.gz cpython-70e368836421a2e8c08dbd043a1540ad56d7ae5c.tar.bz2 |
complex_subtype_from_string(): move the declaration of s_buffer[] out
of the if block where it was before. The name is only used inside
that if block, but the storage is referenced outside it via the 's'
variable.
(This patch was part of SF patch #474590 -- RISC OS support.)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/complexobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 675d5b5..68d842e 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -646,6 +646,9 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) int sw_error=0; int sign; char buffer[256]; /* For errors */ +#ifdef Py_USING_UNICODE + char s_buffer[256]; +#endif int len; if (PyString_Check(v)) { @@ -654,7 +657,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) } #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { - char s_buffer[256]; if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { PyErr_SetString(PyExc_ValueError, "complex() literal too large to convert"); |