diff Python/ceval.c @ 40894:0ea24f4f2467

Bytes literal.
author Thomas Wouters <thomas@python.org>
date Fri, 23 Feb 2007 19:56:57 +0000
parents 04f5cbc74424
children 93f582803733
line wrap: on
line diff
--- a/Python/ceval.c	Fri Feb 23 15:07:44 2007 +0000
+++ b/Python/ceval.c	Fri Feb 23 19:56:57 2007 +0000
@@ -1885,6 +1885,19 @@
 			PUSH(x);
 			if (x != NULL) continue;
 			break;
+		
+		case MAKE_BYTES:
+			w = POP();
+			if (PyString_Check(w))
+				x = PyBytes_FromStringAndSize(
+					PyString_AS_STRING(w),
+					PyString_GET_SIZE(w));
+			else
+				x = NULL;
+			Py_DECREF(w);
+			PUSH(x);
+			if (x != NULL) continue;
+			break;
 
 		case LOAD_ATTR:
 			w = GETITEM(names, oparg);