diff Python/bltinmodule.c @ 47291:04bd3690fb1f legacy-trunk

First step of the C API rename: renamed Include/bytesobject.h to Include/bytearrayobject.h renamed Include/stringobject.h to Include/bytesobject.h added Include/stringobject.h with aliases
author Christian Heimes <christian@cheimes.de>
date Mon, 26 May 2008 12:29:14 +0000
parents d953ea58cc8b
children 4fe192d48960
line wrap: on
line diff
--- a/Python/bltinmodule.c	Mon May 26 11:42:40 2008 +0000
+++ b/Python/bltinmodule.c	Mon May 26 12:29:14 2008 +0000
@@ -1498,10 +1498,10 @@
 			ord = (long)((unsigned char)*PyString_AS_STRING(obj));
 			return PyInt_FromLong(ord);
 		}
-	} else if (PyBytes_Check(obj)) {
-		size = PyBytes_GET_SIZE(obj);
+	} else if (PyByteArray_Check(obj)) {
+		size = PyByteArray_GET_SIZE(obj);
 		if (size == 1) {
-			ord = (long)((unsigned char)*PyBytes_AS_STRING(obj));
+			ord = (long)((unsigned char)*PyByteArray_AS_STRING(obj));
 			return PyInt_FromLong(ord);
 		}
 
@@ -2618,7 +2618,7 @@
 	SETBUILTIN("basestring",	&PyBaseString_Type);
 	SETBUILTIN("bool",		&PyBool_Type);
 	/*	SETBUILTIN("memoryview",        &PyMemoryView_Type); */
-	SETBUILTIN("bytearray",		&PyBytes_Type);
+	SETBUILTIN("bytearray",		&PyByteArray_Type);
 	SETBUILTIN("bytes",		&PyString_Type);
 	SETBUILTIN("buffer",		&PyBuffer_Type);
 	SETBUILTIN("classmethod",	&PyClassMethod_Type);