Nick Coghlan <ncogh...@gmail.com> added the comment: Because a generator can legitimately have no locals:
>>> def gen(): ... yield 1 ... >>> g = gen() >>> g.gi_frame.f_locals {} Errors should be reported as exceptions - AttributeError or TypeError if there's no gi_frame and then ValueError or RuntimeError if gi_frame is None. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13062> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com