summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 7d917bd..361612b 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4824,7 +4824,6 @@ unicode_upper(PyUnicodeObject *self)
return fixup(self, fixupper);
}
-#if 0
static char zfill__doc__[] =
"S.zfill(width) -> unicode\n\
\n\
@@ -4850,6 +4849,9 @@ unicode_zfill(PyUnicodeObject *self, PyObject *args)
u = pad(self, fill, 0, '0');
+ if (u == NULL)
+ return NULL;
+
if (u->str[fill] == '+' || u->str[fill] == '-') {
/* move sign to beginning of string */
u->str[0] = u->str[fill];
@@ -4858,7 +4860,6 @@ unicode_zfill(PyUnicodeObject *self, PyObject *args)
return (PyObject*) u;
}
-#endif
#if 0
static PyObject*
@@ -4970,8 +4971,8 @@ static PyMethodDef unicode_methods[] = {
{"isnumeric", (PyCFunction) unicode_isnumeric, METH_NOARGS, isnumeric__doc__},
{"isalpha", (PyCFunction) unicode_isalpha, METH_NOARGS, isalpha__doc__},
{"isalnum", (PyCFunction) unicode_isalnum, METH_NOARGS, isalnum__doc__},
-#if 0
{"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__},
+#if 0
{"capwords", (PyCFunction) unicode_capwords, METH_NOARGS, capwords__doc__},
#endif