mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
unfortunately we can't kill compiler_new_tmpname here
This commit is contained in:
parent
a1713bdfed
commit
32123370f4
1 changed files with 10 additions and 0 deletions
|
@ -551,6 +551,16 @@ compiler_exit_scope(struct compiler *c)
|
|||
|
||||
}
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue