summaryrefslogtreecommitdiffstats
path: root/Objects/clinic/longobject.c.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-25 11:23:47 (GMT)
committerGitHub <noreply@github.com>2018-12-25 11:23:47 (GMT)
commit32d96a2b5bc3136d45a66adbdb45fac351b520ce (patch)
treeacf51c9945f764ab103597c9cba376f154aa600d /Objects/clinic/longobject.c.h
parent65ce60aef150776f884715b4315a10a0d6ae769e (diff)
downloadcpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.zip
cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.gz
cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.bz2
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
Diffstat (limited to 'Objects/clinic/longobject.c.h')
-rw-r--r--Objects/clinic/longobject.c.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h
index 3c33993..27cdf9e 100644
--- a/Objects/clinic/longobject.c.h
+++ b/Objects/clinic/longobject.c.h
@@ -58,9 +58,14 @@ int___format__(PyObject *self, PyObject *arg)
PyObject *return_value = NULL;
PyObject *format_spec;
- if (!PyArg_Parse(arg, "U:__format__", &format_spec)) {
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("__format__", "str", arg);
goto exit;
}
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ format_spec = arg;
return_value = int___format___impl(self, format_spec);
exit:
@@ -239,4 +244,4 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb
exit:
return return_value;
}
-/*[clinic end generated code: output=403ccd096555fd1e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7436b5f4decdcf9d input=a9049054013a1b77]*/