This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xilun
Recipients xilun
Date 2008-05-18.03:12:11
SpamBayes Score 0.019472633
Marked as misclassified No
Message-id <1211080350.94.0.662865007097.issue2903@psf.upfronthosting.co.za>
In-reply-to
Content
Some 3rd party tracers rely on frame.f_globals["__name__"] to be set to
the module name that contains the code currently executed.
frame.f_globals["__name__"] is not defined when some code has been
generated with exec, which is the way namedtuples are created.

The attached patch set __name__ to '__generated_%s__' % typename in the
generated namespace, which is quite handy to see where the code comes
from. Indeed if sys._getframe is available it sets __name__ to
'__generated_%s__%s__' % (typename, result.__module__) which is even
more useful.
History
Date User Action Args
2008-05-18 03:12:47xilunsetspambayes_score: 0.0194726 -> 0.019472633
recipients: + xilun
2008-05-18 03:12:31xilunsetspambayes_score: 0.0194726 -> 0.0194726
messageid: <1211080350.94.0.662865007097.issue2903@psf.upfronthosting.co.za>
2008-05-18 03:12:28xilunlinkissue2903 messages
2008-05-18 03:12:27xiluncreate