summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-03 17:49:24 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-03 17:49:24 (GMT)
commit8d30cc0144a6a94e06f3a115b07afa6314466cfd (patch)
tree0c0b2f3d75cca4173ec3e8e2962682affbd2e886 /Python/ast.c
parent938ef57e267838dcfbfb0d51d9bd40caece1c5db (diff)
downloadcpython-8d30cc0144a6a94e06f3a115b07afa6314466cfd.zip
cpython-8d30cc0144a6a94e06f3a115b07afa6314466cfd.tar.gz
cpython-8d30cc0144a6a94e06f3a115b07afa6314466cfd.tar.bz2
Get rid of all #ifdef Py_USING_UNICODE (it is always present now).
(With the help of unifdef from freshmeat.)
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/Python/ast.c b/Python/ast.c
index d7e3b36..821a5ad 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3050,10 +3050,6 @@ parsenumber(const char *s)
static PyObject *
decode_utf8(const char **sPtr, const char *end, char* encoding)
{
-#ifndef Py_USING_UNICODE
- Py_FatalError("decode_utf8 should not be called in this build.");
- return NULL;
-#else
PyObject *u, *v;
char *s, *t;
t = s = (char *)*sPtr;
@@ -3066,7 +3062,6 @@ decode_utf8(const char **sPtr, const char *end, char* encoding)
v = PyUnicode_AsEncodedString(u, encoding, NULL);
Py_DECREF(u);
return v;
-#endif
}
static PyObject *
@@ -3186,11 +3181,9 @@ parsestr(const node *n, const char *encoding, int *bytesmode)
return NULL;
}
}
-#ifdef Py_USING_UNICODE
if (!*bytesmode) {
return decode_unicode(s, len, rawmode, encoding);
}
-#endif
if (*bytesmode) {
/* Disallow non-ascii characters (but not escapes) */
const char *c;
@@ -3207,19 +3200,12 @@ parsestr(const node *n, const char *encoding, int *bytesmode)
strcmp(encoding, "iso-8859-1") != 0);
if (rawmode || strchr(s, '\\') == NULL) {
if (need_encoding) {
-#ifndef Py_USING_UNICODE
- /* This should not happen - we never see any other
- encoding. */
- Py_FatalError(
- "cannot deal with encodings in this build.");
-#else
PyObject *v, *u = PyUnicode_DecodeUTF8(s, len, NULL);
if (u == NULL)
return NULL;
v = PyUnicode_AsEncodedString(u, encoding, NULL);
Py_DECREF(u);
return v;
-#endif
} else {
return PyString_FromStringAndSize(s, len);
}
@@ -3258,7 +3244,6 @@ parsestrplus(struct compiling *c, const node *n, int *bytesmode)
if (v == NULL)
goto onError;
}
-#ifdef Py_USING_UNICODE
else {
PyObject *temp = PyUnicode_Concat(v, s);
Py_DECREF(s);
@@ -3267,7 +3252,6 @@ parsestrplus(struct compiling *c, const node *n, int *bytesmode)
if (v == NULL)
goto onError;
}
-#endif
}
}
return v;