diff options
author | Guido van Rossum <guido@python.org> | 2006-03-02 04:24:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-03-02 04:24:01 (GMT) |
commit | 5bde08dba3a34de7f625420035f1d0876bc71f39 (patch) | |
tree | be63f21fd657d9011517d99810b39da0a7484897 /Lib/compiler | |
parent | 3a5468efb08335bff7b2135753cb9a5a9ddce0ac (diff) | |
download | cpython-5bde08dba3a34de7f625420035f1d0876bc71f39.zip cpython-5bde08dba3a34de7f625420035f1d0876bc71f39.tar.gz cpython-5bde08dba3a34de7f625420035f1d0876bc71f39.tar.bz2 |
Fix failure of test_compiler.py when compiling test_contextlib.py.
The culprit was an expression-less yield -- the first apparently in
the standard library. I added a unit test for this.
Also removed the hack to force compilation of test_with.py.
Diffstat (limited to 'Lib/compiler')
-rw-r--r-- | Lib/compiler/transformer.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index eed9ce9..800461c 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -408,11 +408,11 @@ class Transformer: return Discard(expr, lineno=expr.lineno) def yield_expr(self, nodelist): - if len(nodelist)>1: - value = nodelist[1] + if len(nodelist) > 1: + value = self.com_node(nodelist[1]) else: value = Const(None) - return Yield(self.com_node(value), lineno=nodelist[0][2]) + return Yield(value, lineno=nodelist[0][2]) def raise_stmt(self, nodelist): # raise: [test [',' test [',' test]]] |