summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-16 20:46:27 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-16 20:46:27 (GMT)
commit307fa8cc8285d7f39550051e0ce7c8ac5504d13f (patch)
treecbcd60a6d4013867071f442c25581cfe21115575 /Python
parent27ae52362c4c8576987f6a78586b4f9c145100b1 (diff)
downloadcpython-307fa8cc8285d7f39550051e0ce7c8ac5504d13f.zip
cpython-307fa8cc8285d7f39550051e0ce7c8ac5504d13f.tar.gz
cpython-307fa8cc8285d7f39550051e0ce7c8ac5504d13f.tar.bz2
Three patches by Amaury Forgeot d'Arc; SF patch# 1754484.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c14
-rw-r--r--Python/errors.c8
2 files changed, 14 insertions, 8 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 08c1a00..2f4e513 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -314,14 +314,17 @@ builtin_chr(PyObject *self, PyObject *args)
return PyUnicode_FromOrdinal(x);
}
-PyDoc_STRVAR(chr_doc,
+PyDoc_VAR(chr_doc) = PyDoc_STR(
"chr(i) -> Unicode character\n\
\n\
Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."
+)
#ifndef Py_UNICODE_WIDE
+PyDoc_STR(
"\nIf 0x10000 <= i, a surrogate pair is returned."
+)
#endif
-);
+;
static PyObject *
@@ -1219,14 +1222,17 @@ builtin_ord(PyObject *self, PyObject* obj)
return NULL;
}
-PyDoc_STRVAR(ord_doc,
+PyDoc_VAR(ord_doc) = PyDoc_STR(
"ord(c) -> integer\n\
\n\
Return the integer ordinal of a one-character string."
+)
#ifndef Py_UNICODE_WIDE
+PyDoc_STR(
"\nA valid surrogate pair is also accepted."
+)
#endif
-);
+;
static PyObject *
diff --git a/Python/errors.c b/Python/errors.c
index 2a84c8d..3770522 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -333,9 +333,9 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
#endif /* Unix/Windows */
#endif /* PLAN 9*/
if (filenameObject != NULL)
- v = Py_BuildValue("(isO)", i, s, filenameObject);
+ v = Py_BuildValue("(iUO)", i, s, filenameObject);
else
- v = Py_BuildValue("(is)", i, s);
+ v = Py_BuildValue("(iU)", i, s);
if (v != NULL) {
PyErr_SetObject(exc, v);
Py_DECREF(v);
@@ -413,9 +413,9 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject(
s[--len] = '\0';
}
if (filenameObject != NULL)
- v = Py_BuildValue("(isO)", err, s, filenameObject);
+ v = Py_BuildValue("(iUO)", err, s, filenameObject);
else
- v = Py_BuildValue("(is)", err, s);
+ v = Py_BuildValue("(iU)", err, s);
if (v != NULL) {
PyErr_SetObject(exc, v);
Py_DECREF(v);