summaryrefslogtreecommitdiff
path: root/Objects/stringlib/formatter.h
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringlib/formatter.h')
-rw-r--r--Objects/stringlib/formatter.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h
index 22dd292ce9..05ccfeae3d 100644
--- a/Objects/stringlib/formatter.h
+++ b/Objects/stringlib/formatter.h
@@ -778,7 +778,7 @@ FORMAT_STRING(PyObject* value, PyObject* args)
/* This is to allow things like u''.format('') */
if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
goto done;
- if (!(PyString_Check(format_spec) || PyUnicode_Check(format_spec))) {
+ if (!(PyBytes_Check(format_spec) || PyUnicode_Check(format_spec))) {
PyErr_Format(PyExc_TypeError, "__format__ arg must be str "
"or unicode, not %s", Py_TYPE(format_spec)->tp_name);
goto done;