[Python-3000-checkins] r56403 - in python/branches/py3k-struni: Objects/unicodeobject.c Python/bltinmodule.c Python/errors.c

guido.van.rossum python-3000-checkins at python.org
Mon Jul 16 22:46:27 CEST 2007


Author: guido.van.rossum
Date: Mon Jul 16 22:46:27 2007
New Revision: 56403

Modified:
   python/branches/py3k-struni/Objects/unicodeobject.c
   python/branches/py3k-struni/Python/bltinmodule.c
   python/branches/py3k-struni/Python/errors.c
Log:
Three patches by Amaury Forgeot d'Arc; SF patch# 1754484.


Modified: python/branches/py3k-struni/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/unicodeobject.c	(original)
+++ python/branches/py3k-struni/Objects/unicodeobject.c	Mon Jul 16 22:46:27 2007
@@ -851,7 +851,7 @@
  fail:
 	if (callresults) {
 		PyObject **callresult2 = callresults;
-		while (callresult2 <= callresult) {
+		while (callresult2 < callresult) {
 			Py_DECREF(*callresult2);
 			++callresult2;
 		}

Modified: python/branches/py3k-struni/Python/bltinmodule.c
==============================================================================
--- python/branches/py3k-struni/Python/bltinmodule.c	(original)
+++ python/branches/py3k-struni/Python/bltinmodule.c	Mon Jul 16 22:46:27 2007
@@ -314,14 +314,17 @@
 	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 @@
 	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 *

Modified: python/branches/py3k-struni/Python/errors.c
==============================================================================
--- python/branches/py3k-struni/Python/errors.c	(original)
+++ python/branches/py3k-struni/Python/errors.c	Mon Jul 16 22:46:27 2007
@@ -333,9 +333,9 @@
 #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 @@
 			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);


More information about the Python-3000-checkins mailing list