summaryrefslogtreecommitdiffstats
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-07 19:57:46 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-07 19:57:46 (GMT)
commit7eeb5b5e5017cf1354b084327b49390044946069 (patch)
tree6105fb6e6fa76d1d0e3c4d6e987b91aa623f7fc3 /Python/modsupport.c
parentfa68a6188a16562c1b4ba8cf879ce49decba5546 (diff)
downloadcpython-7eeb5b5e5017cf1354b084327b49390044946069.zip
cpython-7eeb5b5e5017cf1354b084327b49390044946069.tar.gz
cpython-7eeb5b5e5017cf1354b084327b49390044946069.tar.bz2
Issue #8848: U / U# formats of Py_BuildValue() are just alias to s / s#
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c
index a68e10b..5f5d842 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -302,39 +302,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
case 's':
case 'z':
- {
- PyObject *v;
- char *str = va_arg(*p_va, char *);
- Py_ssize_t n;
- if (**p_format == '#') {
- ++*p_format;
- if (flags & FLAG_SIZE_T)
- n = va_arg(*p_va, Py_ssize_t);
- else
- n = va_arg(*p_va, int);
- }
- else
- n = -1;
- if (str == NULL) {
- v = Py_None;
- Py_INCREF(v);
- }
- else {
- if (n < 0) {
- size_t m = strlen(str);
- if (m > PY_SSIZE_T_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "string too long for Python string");
- return NULL;
- }
- n = (Py_ssize_t)m;
- }
- v = PyUnicode_FromStringAndSize(str, n);
- }
- return v;
- }
-
- case 'U':
+ case 'U': /* XXX deprecated alias */
{
PyObject *v;
char *str = va_arg(*p_va, char *);