[pypy-commit] pypy py3.5: Issue #2768: rare case involving __del__ methods
arigo
pypy.commits at gmail.com
Thu Apr 12 05:26:17 EDT 2018
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r94311:4db4624409b4
Date: 2018-04-12 10:25 +0100
http://bitbucket.org/pypy/pypy/changeset/4db4624409b4/
Log: Issue #2768: rare case involving __del__ methods
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1098,7 +1098,13 @@
# sub-iterable first before continuing on the next bytecode.
from pypy.interpreter.generator import Coroutine
in_generator = self.get_generator()
- assert in_generator is not None
+ if in_generator is None:
+ # Issue #2768: rare case involving __del__ methods.
+ # XXX This is a workaround, not a proper solution.
+ raise oefmt(self.space.w_RuntimeError,
+ "PyPy limitation: cannot use 'yield from' or 'await' "
+ "in a generator/coroutine that has been partially "
+ "deallocated already, typically seen via __del__")
w_inputvalue = self.popvalue() # that's always w_None, actually
w_gen = self.popvalue()
#
More information about the pypy-commit
mailing list