summaryrefslogtreecommitdiff
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-11-28 19:09:45 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2011-11-28 19:09:45 +0100
commit3a852cd214d726eb2bb96f94e498eda7ba042887 (patch)
tree71081d83765f4c721093b504ca9bd3b7673d41cd /Python/modsupport.c
parent07ee349b41ca8f94aadaf39be3ec9ca5aca692f9 (diff)
parent07b3714e5b40f0208a7640d315213a479d3742a0 (diff)
downloadcpython-3a852cd214d726eb2bb96f94e498eda7ba042887.tar.gz
Issue #7111: Python can now be run without a stdin, stdout or stderr stream.
It was already the case with Python 2. However, the corresponding sys module entries are now set to None (instead of an unusable file object).
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c
index 85b0d66358..428914f378 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -148,15 +148,6 @@ do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags)
return v;
}
-static int
-_ustrlen(Py_UNICODE *u)
-{
- int i = 0;
- Py_UNICODE *v = u;
- while (*v != 0) { i++; v++; }
- return i;
-}
-
static PyObject *
do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags)
{
@@ -269,7 +260,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
}
else {
if (n < 0)
- n = _ustrlen(u);
+ n = Py_UNICODE_strlen(u);
v = PyUnicode_FromUnicode(u, n);
}
return v;
@@ -292,11 +283,6 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
case 'C':
{
int i = va_arg(*p_va, int);
- if (i < 0 || i > PyUnicode_GetMax()) {
- PyErr_SetString(PyExc_OverflowError,
- "%c arg not in range(0x110000)");
- return NULL;
- }
return PyUnicode_FromOrdinal(i);
}