Kaydet (Commit) 307fa8cc authored tarafından Guido van Rossum's avatar Guido van Rossum

Three patches by Amaury Forgeot d'Arc; SF patch# 1754484.

üst 27ae5236
...@@ -851,7 +851,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) ...@@ -851,7 +851,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
fail: fail:
if (callresults) { if (callresults) {
PyObject **callresult2 = callresults; PyObject **callresult2 = callresults;
while (callresult2 <= callresult) { while (callresult2 < callresult) {
Py_DECREF(*callresult2); Py_DECREF(*callresult2);
++callresult2; ++callresult2;
} }
......
...@@ -314,14 +314,17 @@ builtin_chr(PyObject *self, PyObject *args) ...@@ -314,14 +314,17 @@ builtin_chr(PyObject *self, PyObject *args)
return PyUnicode_FromOrdinal(x); return PyUnicode_FromOrdinal(x);
} }
PyDoc_STRVAR(chr_doc, PyDoc_VAR(chr_doc) = PyDoc_STR(
"chr(i) -> Unicode character\n\ "chr(i) -> Unicode character\n\
\n\ \n\
Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff." Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."
)
#ifndef Py_UNICODE_WIDE #ifndef Py_UNICODE_WIDE
PyDoc_STR(
"\nIf 0x10000 <= i, a surrogate pair is returned." "\nIf 0x10000 <= i, a surrogate pair is returned."
)
#endif #endif
); ;
static PyObject * static PyObject *
...@@ -1219,14 +1222,17 @@ builtin_ord(PyObject *self, PyObject* obj) ...@@ -1219,14 +1222,17 @@ builtin_ord(PyObject *self, PyObject* obj)
return NULL; return NULL;
} }
PyDoc_STRVAR(ord_doc, PyDoc_VAR(ord_doc) = PyDoc_STR(
"ord(c) -> integer\n\ "ord(c) -> integer\n\
\n\ \n\
Return the integer ordinal of a one-character string." Return the integer ordinal of a one-character string."
)
#ifndef Py_UNICODE_WIDE #ifndef Py_UNICODE_WIDE
PyDoc_STR(
"\nA valid surrogate pair is also accepted." "\nA valid surrogate pair is also accepted."
)
#endif #endif
); ;
static PyObject * static PyObject *
......
...@@ -333,9 +333,9 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject) ...@@ -333,9 +333,9 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
#endif /* Unix/Windows */ #endif /* Unix/Windows */
#endif /* PLAN 9*/ #endif /* PLAN 9*/
if (filenameObject != NULL) if (filenameObject != NULL)
v = Py_BuildValue("(isO)", i, s, filenameObject); v = Py_BuildValue("(iUO)", i, s, filenameObject);
else else
v = Py_BuildValue("(is)", i, s); v = Py_BuildValue("(iU)", i, s);
if (v != NULL) { if (v != NULL) {
PyErr_SetObject(exc, v); PyErr_SetObject(exc, v);
Py_DECREF(v); Py_DECREF(v);
...@@ -413,9 +413,9 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject( ...@@ -413,9 +413,9 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject(
s[--len] = '\0'; s[--len] = '\0';
} }
if (filenameObject != NULL) if (filenameObject != NULL)
v = Py_BuildValue("(isO)", err, s, filenameObject); v = Py_BuildValue("(iUO)", err, s, filenameObject);
else else
v = Py_BuildValue("(is)", err, s); v = Py_BuildValue("(iU)", err, s);
if (v != NULL) { if (v != NULL) {
PyErr_SetObject(exc, v); PyErr_SetObject(exc, v);
Py_DECREF(v); Py_DECREF(v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment