[Python-checkins] r73659 - python/branches/release31-maint/Python/compile.c

benjamin.peterson python-checkins at python.org
Mon Jun 29 00:36:18 CEST 2009


Author: benjamin.peterson
Date: Mon Jun 29 00:36:18 2009
New Revision: 73659

Log:
unfortunately we can't kill compiler_new_tmpname here

Modified:
   python/branches/release31-maint/Python/compile.c

Modified: python/branches/release31-maint/Python/compile.c
==============================================================================
--- python/branches/release31-maint/Python/compile.c	(original)
+++ python/branches/release31-maint/Python/compile.c	Mon Jun 29 00:36:18 2009
@@ -551,6 +551,16 @@
 
 }
 
+/* Allocate a new "anonymous" local variable.  Used by with statements. */ 	 
+	  	 
+static PyObject * 	 
+compiler_new_tmpname(struct compiler *c) 	 
+{ 	 
+	char tmpname[256]; 	 
+	PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->u->u_tmpname); 	 
+	return PyUnicode_FromString(tmpname); 	 
+}
+
 /* Allocate a new block and return a pointer to it.
    Returns NULL on error.
 */


More information about the Python-checkins mailing list