Author xilun
Recipients xilun
Date 2008-05-18.03:12:11
SpamBayes Score 0.0194726
Marked as misclassified No
Message-id <>
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.
Date User Action Args
2008-05-18 03:12:47xilunsetspambayes_score: 0.0194726 -> 0.0194726
recipients: + xilun
2008-05-18 03:12:31xilunsetspambayes_score: 0.0194726 -> 0.0194726
messageid: <>
2008-05-18 03:12:28xilunlinkissue2903 messages
2008-05-18 03:12:27xiluncreate