Get rid of all #ifdef Py_USING_UNICODE (it is always present now).
(With the help of unifdef from freshmeat.)
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 5a34b96..645fd95 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -931,13 +931,11 @@
*/
return long_from_string(PyString_AS_STRING(o),
PyString_GET_SIZE(o));
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(o))
/* The above check is done in PyLong_FromUnicode(). */
return PyLong_FromUnicode(PyUnicode_AS_UNICODE(o),
PyUnicode_GET_SIZE(o),
10);
-#endif
if (!PyObject_AsCharBuffer(o, &buffer, &buffer_len))
return long_from_string(buffer, buffer_len);
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 82dd7c1..b65a982 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -696,16 +696,13 @@
int sw_error=0;
int sign;
char buffer[256]; /* For errors */
-#ifdef Py_USING_UNICODE
char s_buffer[256];
-#endif
Py_ssize_t len;
if (PyString_Check(v)) {
s = PyString_AS_STRING(v);
len = PyString_GET_SIZE(v);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(v)) {
if (PyUnicode_GET_SIZE(v) >= (Py_ssize_t)sizeof(s_buffer)) {
PyErr_SetString(PyExc_ValueError,
@@ -720,7 +717,6 @@
s = s_buffer;
len = strlen(s);
}
-#endif
else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError,
"complex() arg is not a string");
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 2b05cc5..e30e9df 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1183,7 +1183,6 @@
SimpleExtendsException(PyExc_ValueError, UnicodeError,
"Unicode related error.");
-#ifdef Py_USING_UNICODE
static int
get_int(PyObject *attr, Py_ssize_t *value, const char *name)
{
@@ -1788,7 +1787,6 @@
return PyObject_CallFunction(PyExc_UnicodeTranslateError, "u#nns",
object, length, start, end, reason);
}
-#endif
/*
@@ -1989,11 +1987,9 @@
PRE_INIT(KeyError)
PRE_INIT(ValueError)
PRE_INIT(UnicodeError)
-#ifdef Py_USING_UNICODE
PRE_INIT(UnicodeEncodeError)
PRE_INIT(UnicodeDecodeError)
PRE_INIT(UnicodeTranslateError)
-#endif
PRE_INIT(AssertionError)
PRE_INIT(ArithmeticError)
PRE_INIT(FloatingPointError)
@@ -2051,11 +2047,9 @@
POST_INIT(KeyError)
POST_INIT(ValueError)
POST_INIT(UnicodeError)
-#ifdef Py_USING_UNICODE
POST_INIT(UnicodeEncodeError)
POST_INIT(UnicodeDecodeError)
POST_INIT(UnicodeTranslateError)
-#endif
POST_INIT(AssertionError)
POST_INIT(ArithmeticError)
POST_INIT(FloatingPointError)
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index d12e132..50b3cd6 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -412,7 +412,6 @@
file_repr(PyFileObject *f)
{
if (PyUnicode_Check(f->f_name)) {
-#ifdef Py_USING_UNICODE
PyObject *ret = NULL;
PyObject *name = PyUnicode_AsUnicodeEscapeString(f->f_name);
const char *name_str = name ? PyString_AsString(name) : "?";
@@ -423,7 +422,6 @@
f);
Py_XDECREF(name);
return ret;
-#endif
} else {
return PyString_FromFormat("<%s file '%s', mode '%s' at %p>",
f->f_fp == NULL ? "closed" : "open",
@@ -1337,7 +1335,6 @@
}
}
}
-#ifdef Py_USING_UNICODE
if (n < 0 && result != NULL && PyUnicode_Check(result)) {
Py_UNICODE *s = PyUnicode_AS_UNICODE(result);
Py_ssize_t len = PyUnicode_GET_SIZE(result);
@@ -1358,7 +1355,6 @@
}
}
}
-#endif
return result;
}
@@ -2124,15 +2120,12 @@
}
else if (PyFile_Check(f)) {
FILE *fp = PyFile_AsFile(f);
-#ifdef Py_USING_UNICODE
PyObject *enc = ((PyFileObject*)f)->f_encoding;
int result;
-#endif
if (fp == NULL) {
err_closed();
return -1;
}
-#ifdef Py_USING_UNICODE
if ((flags & Py_PRINT_RAW) &&
PyUnicode_Check(v) && enc != Py_None) {
char *cenc = PyString_AS_STRING(enc);
@@ -2146,9 +2139,6 @@
result = PyObject_Print(value, fp, flags);
Py_DECREF(value);
return result;
-#else
- return PyObject_Print(v, fp, flags);
-#endif
}
writer = PyObject_GetAttrString(f, "write");
if (writer == NULL)
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 9e6db54..fde2380 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -68,16 +68,13 @@
const char *s, *last, *end;
double x;
char buffer[256]; /* for errors */
-#ifdef Py_USING_UNICODE
char s_buffer[256]; /* for objects convertible to a char buffer */
-#endif
Py_ssize_t len;
if (PyString_Check(v)) {
s = PyString_AS_STRING(v);
len = PyString_GET_SIZE(v);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(v)) {
if (PyUnicode_GET_SIZE(v) >= (Py_ssize_t)sizeof(s_buffer)) {
PyErr_SetString(PyExc_ValueError,
@@ -92,7 +89,6 @@
s = s_buffer;
len = strlen(s);
}
-#endif
else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError,
"float() argument must be a string or a number");
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 932b616..0aae6ac 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -387,7 +387,6 @@
return PyInt_FromLong(x);
}
-#ifdef Py_USING_UNICODE
PyObject *
PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base)
{
@@ -405,7 +404,6 @@
PyMem_FREE(buffer);
return result;
}
-#endif
/* Methods */
@@ -986,12 +984,10 @@
}
return PyInt_FromString(string, NULL, base);
}
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(x))
return PyInt_FromUnicode(PyUnicode_AS_UNICODE(x),
PyUnicode_GET_SIZE(x),
base);
-#endif
PyErr_SetString(PyExc_TypeError,
"int() can't convert non-string with explicit base");
return NULL;
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 95abfdd..61e5bed 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -1939,7 +1939,6 @@
return NULL;
}
-#ifdef Py_USING_UNICODE
PyObject *
PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
{
@@ -1957,7 +1956,6 @@
PyMem_FREE(buffer);
return result;
}
-#endif
/* forward */
static PyLongObject *x_divrem
@@ -3538,12 +3536,10 @@
}
return PyLong_FromString(PyString_AS_STRING(x), NULL, base);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(x))
return PyLong_FromUnicode(PyUnicode_AS_UNICODE(x),
PyUnicode_GET_SIZE(x),
base);
-#endif
else {
PyErr_SetString(PyExc_TypeError,
"int() can't convert non-string with explicit base");
diff --git a/Objects/object.c b/Objects/object.c
index 0bf0c60..ada1d1e 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -361,7 +361,6 @@
res = (*v->ob_type->tp_repr)(v);
if (res == NULL)
return NULL;
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(res)) {
PyObject* str;
str = PyUnicode_AsEncodedString(res, NULL, NULL);
@@ -371,7 +370,6 @@
else
return NULL;
}
-#endif
if (!PyString_Check(res)) {
PyErr_Format(PyExc_TypeError,
"__repr__ returned non-string (type %.200s)",
@@ -394,12 +392,10 @@
Py_INCREF(v);
return v;
}
-#ifdef Py_USING_UNICODE
if (PyUnicode_CheckExact(v)) {
Py_INCREF(v);
return v;
}
-#endif
if (v->ob_type->tp_str == NULL)
return PyObject_Repr(v);
@@ -407,9 +403,7 @@
if (res == NULL)
return NULL;
type_ok = PyString_Check(res);
-#ifdef Py_USING_UNICODE
type_ok = type_ok || PyUnicode_Check(res);
-#endif
if (!type_ok) {
PyErr_Format(PyExc_TypeError,
"__str__ returned non-string (type %.200s)",
@@ -426,7 +420,6 @@
PyObject *res = _PyObject_Str(v);
if (res == NULL)
return NULL;
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(res)) {
PyObject* str;
str = PyUnicode_AsEncodedString(res, NULL, NULL);
@@ -436,12 +429,10 @@
else
return NULL;
}
-#endif
assert(PyString_Check(res));
return res;
}
-#ifdef Py_USING_UNICODE
PyObject *
PyObject_Unicode(PyObject *v)
{
@@ -502,7 +493,6 @@
}
return res;
}
-#endif
/* The new comparison philosophy is: we completely separate three-way
@@ -895,7 +885,6 @@
PyTypeObject *tp = v->ob_type;
if (!PyString_Check(name)) {
-#ifdef Py_USING_UNICODE
/* The Unicode to string conversion is done here because the
existing tp_getattro slots expect a string object as name
and we wouldn't want to break those. */
@@ -905,7 +894,6 @@
return NULL;
}
else
-#endif
{
PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
@@ -942,7 +930,6 @@
int err;
if (!PyString_Check(name)){
-#ifdef Py_USING_UNICODE
/* The Unicode to string conversion is done here because the
existing tp_setattro slots expect a string object as name
and we wouldn't want to break those. */
@@ -952,7 +939,6 @@
return -1;
}
else
-#endif
{
PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
@@ -1039,7 +1025,6 @@
PyObject **dictptr;
if (!PyString_Check(name)){
-#ifdef Py_USING_UNICODE
/* The Unicode to string conversion is done here because the
existing tp_setattro slots expect a string object as name
and we wouldn't want to break those. */
@@ -1049,7 +1034,6 @@
return NULL;
}
else
-#endif
{
PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
@@ -1157,7 +1141,6 @@
int res = -1;
if (!PyString_Check(name)){
-#ifdef Py_USING_UNICODE
/* The Unicode to string conversion is done here because the
existing tp_setattro slots expect a string object as name
and we wouldn't want to break those. */
@@ -1167,7 +1150,6 @@
return -1;
}
else
-#endif
{
PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 68bf703..248070f 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -379,12 +379,7 @@
}
if (encoding == NULL) {
-#ifdef Py_USING_UNICODE
encoding = PyUnicode_GetDefaultEncoding();
-#else
- PyErr_SetString(PyExc_ValueError, "no encoding specified");
- goto onError;
-#endif
}
/* Decode via the codec registry */
@@ -408,7 +403,6 @@
if (v == NULL)
goto onError;
-#ifdef Py_USING_UNICODE
/* Convert Unicode to a string using the default encoding */
if (PyUnicode_Check(v)) {
PyObject *temp = v;
@@ -417,7 +411,6 @@
if (v == NULL)
goto onError;
}
-#endif
if (!PyString_Check(v)) {
PyErr_Format(PyExc_TypeError,
"decoder did not return a string object (type=%.400s)",
@@ -459,12 +452,7 @@
}
if (encoding == NULL) {
-#ifdef Py_USING_UNICODE
encoding = PyUnicode_GetDefaultEncoding();
-#else
- PyErr_SetString(PyExc_ValueError, "no encoding specified");
- goto onError;
-#endif
}
/* Encode via the codec registry */
@@ -488,7 +476,6 @@
if (v == NULL)
goto onError;
-#ifdef Py_USING_UNICODE
/* Convert Unicode to a string using the default encoding */
if (PyUnicode_Check(v)) {
PyObject *temp = v;
@@ -497,7 +484,6 @@
if (v == NULL)
goto onError;
}
-#endif
if (!PyString_Check(v)) {
PyErr_Format(PyExc_TypeError,
"encoder did not return a string object (type=%.400s)",
@@ -560,7 +546,6 @@
while (s < end) {
if (*s != '\\') {
non_esc:
-#ifdef Py_USING_UNICODE
if (recode_encoding && (*s & 0x80)) {
PyObject *u, *w;
char *r;
@@ -589,9 +574,6 @@
} else {
*p++ = *s++;
}
-#else
- *p++ = *s++;
-#endif
continue;
}
s++;
@@ -663,17 +645,6 @@
errors);
goto failed;
}
-#ifndef Py_USING_UNICODE
- case 'u':
- case 'U':
- case 'N':
- if (unicode) {
- PyErr_SetString(PyExc_ValueError,
- "Unicode escapes not legal "
- "when Unicode disabled");
- goto failed;
- }
-#endif
default:
*p++ = '\\';
s--;
@@ -739,17 +710,15 @@
}
if (!PyString_Check(obj)) {
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(obj)) {
obj = _PyUnicode_AsDefaultEncodedString(obj, NULL);
if (obj == NULL)
return -1;
}
else
-#endif
{
PyErr_Format(PyExc_TypeError,
- "expected string or Unicode object, "
+ "expected str object, "
"%.200s found", obj->ob_type->tp_name);
return -1;
}
@@ -944,10 +913,8 @@
register Py_ssize_t size;
register PyStringObject *op;
if (!PyString_Check(bb)) {
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(bb))
return PyUnicode_Concat((PyObject *)a, bb);
-#endif
if (PyBytes_Check(bb))
return PyBytes_Concat((PyObject *)a, bb);
PyErr_Format(PyExc_TypeError,
@@ -1068,10 +1035,8 @@
string_contains(PyObject *str_obj, PyObject *sub_obj)
{
if (!PyString_CheckExact(sub_obj)) {
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(sub_obj))
return PyUnicode_Contains(str_obj, sub_obj);
-#endif
if (!PyString_Check(sub_obj)) {
PyErr_Format(PyExc_TypeError,
"'in <string>' requires string as left operand, "
@@ -1477,10 +1442,8 @@
sub = PyString_AS_STRING(subobj);
n = PyString_GET_SIZE(subobj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(subobj))
return PyUnicode_Split((PyObject *)self, subobj, maxsplit);
-#endif
else if (PyObject_AsCharBuffer(subobj, &sub, &n))
return NULL;
@@ -1543,10 +1506,8 @@
sep = PyString_AS_STRING(sep_obj);
sep_len = PyString_GET_SIZE(sep_obj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(sep_obj))
return PyUnicode_Partition((PyObject *) self, sep_obj);
-#endif
else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
return NULL;
@@ -1574,10 +1535,8 @@
sep = PyString_AS_STRING(sep_obj);
sep_len = PyString_GET_SIZE(sep_obj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(sep_obj))
return PyUnicode_Partition((PyObject *) self, sep_obj);
-#endif
else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
return NULL;
@@ -1684,10 +1643,8 @@
sub = PyString_AS_STRING(subobj);
n = PyString_GET_SIZE(subobj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(subobj))
return PyUnicode_RSplit((PyObject *)self, subobj, maxsplit);
-#endif
else if (PyObject_AsCharBuffer(subobj, &sub, &n))
return NULL;
@@ -1774,7 +1731,6 @@
const size_t old_sz = sz;
item = PySequence_Fast_GET_ITEM(seq, i);
if (!PyString_Check(item)){
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(item)) {
/* Defer to Unicode join.
* CAUTION: There's no gurantee that the
@@ -1786,7 +1742,6 @@
Py_DECREF(seq);
return result;
}
-#endif
PyErr_Format(PyExc_TypeError,
"sequence item %zd: expected string,"
" %.80s found",
@@ -1868,11 +1823,9 @@
sub = PyString_AS_STRING(subobj);
sub_len = PyString_GET_SIZE(subobj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(subobj))
return PyUnicode_Find(
(PyObject *)self, subobj, start, end, dir);
-#endif
else if (PyObject_AsCharBuffer(subobj, &sub, &sub_len))
/* XXX - the "expected a character buffer object" is pretty
confusing for a non-expert. remap to something else ? */
@@ -2041,7 +1994,6 @@
if (sep != NULL && sep != Py_None) {
if (PyString_Check(sep))
return do_xstrip(self, striptype, sep);
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(sep)) {
PyObject *uniself = PyUnicode_FromObject((PyObject *)self);
PyObject *res;
@@ -2052,13 +2004,8 @@
Py_DECREF(uniself);
return res;
}
-#endif
PyErr_Format(PyExc_TypeError,
-#ifdef Py_USING_UNICODE
- "%s arg must be None, str or unicode",
-#else
"%s arg must be None or str",
-#endif
STRIPNAME(striptype));
return NULL;
}
@@ -2068,7 +2015,7 @@
PyDoc_STRVAR(strip__doc__,
-"S.strip([chars]) -> string or unicode\n\
+"S.strip([chars]) -> str\n\
\n\
Return a copy of the string S with leading and trailing\n\
whitespace removed.\n\
@@ -2086,7 +2033,7 @@
PyDoc_STRVAR(lstrip__doc__,
-"S.lstrip([chars]) -> string or unicode\n\
+"S.lstrip([chars]) -> str\n\
\n\
Return a copy of the string S with leading whitespace removed.\n\
If chars is given and not None, remove characters in chars instead.\n\
@@ -2103,7 +2050,7 @@
PyDoc_STRVAR(rstrip__doc__,
-"S.rstrip([chars]) -> string or unicode\n\
+"S.rstrip([chars]) -> str\n\
\n\
Return a copy of the string S with trailing whitespace removed.\n\
If chars is given and not None, remove characters in chars instead.\n\
@@ -2281,7 +2228,6 @@
sub = PyString_AS_STRING(sub_obj);
sub_len = PyString_GET_SIZE(sub_obj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(sub_obj)) {
Py_ssize_t count;
count = PyUnicode_Count((PyObject *)self, sub_obj, start, end);
@@ -2290,7 +2236,6 @@
else
return PyInt_FromSsize_t(count);
}
-#endif
else if (PyObject_AsCharBuffer(sub_obj, &sub, &sub_len))
return NULL;
@@ -2367,7 +2312,6 @@
table = NULL;
tablen = 256;
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(tableobj)) {
/* Unicode .translate() does not support the deletechars
parameter; instead a mapping to None will cause characters
@@ -2379,7 +2323,6 @@
}
return PyUnicode_Translate((PyObject *)self, tableobj, NULL);
}
-#endif
else if (PyObject_AsCharBuffer(tableobj, &table, &tablen))
return NULL;
@@ -2394,13 +2337,11 @@
del_table = PyString_AS_STRING(delobj);
dellen = PyString_GET_SIZE(delobj);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(delobj)) {
PyErr_SetString(PyExc_TypeError,
"deletions are implemented differently for unicode");
return NULL;
}
-#endif
else if (PyObject_AsCharBuffer(delobj, &del_table, &dellen))
return NULL;
}
@@ -3069,11 +3010,9 @@
from_s = PyString_AS_STRING(from);
from_len = PyString_GET_SIZE(from);
}
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(from))
return PyUnicode_Replace((PyObject *)self,
from, to, count);
-#endif
else if (PyObject_AsCharBuffer(from, &from_s, &from_len))
return NULL;
@@ -3081,11 +3020,9 @@
to_s = PyString_AS_STRING(to);
to_len = PyString_GET_SIZE(to);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(to))
return PyUnicode_Replace((PyObject *)self,
from, to, count);
-#endif
else if (PyObject_AsCharBuffer(to, &to_s, &to_len))
return NULL;
@@ -3113,11 +3050,9 @@
sub = PyString_AS_STRING(substr);
slen = PyString_GET_SIZE(substr);
}
-#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(substr))
return PyUnicode_Tailmatch((PyObject *)self,
substr, start, end, direction);
-#endif
else if (PyObject_AsCharBuffer(substr, &sub, &slen))
return -1;
str = PyString_AS_STRING(self);
@@ -4009,7 +3944,7 @@
PyTypeObject PyString_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
- "str8",
+ "str",
sizeof(PyStringObject),
sizeof(char),
string_dealloc, /* tp_dealloc */
@@ -4458,9 +4393,7 @@
Py_ssize_t reslen, rescnt, fmtcnt;
int args_owned = 0;
PyObject *result, *orig_args;
-#ifdef Py_USING_UNICODE
PyObject *v, *w;
-#endif
PyObject *dict = NULL;
if (format == NULL || !PyString_Check(format) || args == NULL) {
PyErr_BadInternalCall();
@@ -4512,10 +4445,8 @@
Py_ssize_t len;
char formatbuf[FORMATBUFLEN];
/* For format{float,int,char}() */
-#ifdef Py_USING_UNICODE
char *fmt_start = fmt;
Py_ssize_t argidx_start = argidx;
-#endif
fmt++;
if (*fmt == '(') {
@@ -4669,22 +4600,18 @@
len = 1;
break;
case 's':
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(v)) {
fmt = fmt_start;
argidx = argidx_start;
goto unicode;
}
-#endif
temp = _PyObject_Str(v);
-#ifdef Py_USING_UNICODE
if (temp != NULL && PyUnicode_Check(temp)) {
Py_DECREF(temp);
fmt = fmt_start;
argidx = argidx_start;
goto unicode;
}
-#endif
/* Fall through */
case 'r':
if (c == 'r')
@@ -4749,13 +4676,11 @@
fill = '0';
break;
case 'c':
-#ifdef Py_USING_UNICODE
if (PyUnicode_Check(v)) {
fmt = fmt_start;
argidx = argidx_start;
goto unicode;
}
-#endif
pbuf = formatbuf;
len = formatchar(pbuf, sizeof(formatbuf), v);
if (len < 0)
@@ -4864,7 +4789,6 @@
_PyString_Resize(&result, reslen - rescnt);
return result;
-#ifdef Py_USING_UNICODE
unicode:
if (args_owned) {
Py_DECREF(args);
@@ -4909,7 +4833,6 @@
Py_DECREF(v);
Py_DECREF(args);
return w;
-#endif /* Py_USING_UNICODE */
error:
Py_DECREF(result);
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index bf77bea..f743196 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1505,7 +1505,6 @@
return 1;
}
-#ifdef Py_USING_UNICODE
/* Replace Unicode objects in slots. */
static PyObject *
@@ -1539,7 +1538,6 @@
}
return slots;
}
-#endif
/* Forward */
static int
@@ -1713,7 +1711,6 @@
return NULL;
}
-#ifdef Py_USING_UNICODE
tmp = _unicode_to_string(slots, nslots);
if (tmp == NULL)
goto bad_slots;
@@ -1721,7 +1718,6 @@
Py_DECREF(slots);
slots = tmp;
}
-#endif
/* Check for valid slot names and two special cases */
for (i = 0; i < nslots; i++) {
PyObject *tmp = PyTuple_GET_ITEM(slots, i);