Message144799
| Author |
ncoghlan |
| Recipients |
Yury.Selivanov, daniel.urban, eric.snow, meador.inge, ncoghlan |
| Date |
2011年10月03日.02:02:59 |
| SpamBayes Score |
0.0032303182 |
| Marked as misclassified |
No |
| Message-id |
<1317607379.86.0.272110831639.issue13062@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|