-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore failure to delete list comp variables
When iterating over a generator expression `gen` in a list comprehension `[for x in gen]`, the local variable `x` holds the value of each generated expression. When the list comprehension is done being evaluated, the local variable `x` needs to be deleted. This was already being done. If, however, `gen` is empty, `x` is never defined, and so deleting it causes an error. This patch adds a check to ignore that error.
- Loading branch information
Showing
2 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters