mirror of
https://github.com/python/cpython.git
synced 2025-07-12 22:05:16 +00:00
Preliminary support for "from __future__ import generators" to enable
the yield statement. I figure we have to have this in before I can release 2.2a1 on Wednesday. Note: test_generators is currently broken, I'm counting on Tim to fix this.
This commit is contained in:
parent
045ca7ae72
commit
b09f7ed623
8 changed files with 47 additions and 3 deletions
|
@ -31,6 +31,8 @@ future_check_features(PyFutureFeatures *ff, node *n, char *filename)
|
|||
feature = STR(CHILD(ch, 0));
|
||||
if (strcmp(feature, FUTURE_NESTED_SCOPES) == 0) {
|
||||
ff->ff_nested_scopes = 1;
|
||||
} else if (strcmp(feature, FUTURE_GENERATORS) == 0) {
|
||||
/* OK; this is processed by the parser */
|
||||
} else if (strcmp(feature, "braces") == 0) {
|
||||
PyErr_SetString(PyExc_SyntaxError,
|
||||
"not a chance");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue