Neal Norwitz <[EMAIL PROTECTED]> added the comment: Why not use the normal recursion check mechanism? Specifically,
if (Py_EnterRecursiveCall("unicode % ")) return NULL; // err = Warn(); Py_LeaveRecursiveCall(); I don't see where the problem with threads comes in. The GIL is held and shouldn't be released during this call. That may not be quite true (it's conceivable the GIL is released when warning). I'm not sure what happens with the I/O system at this point, it's possible that releases the GIL. However, if GIL is released and re-acquired in PyWarn_WarnEx() there are probably bigger issues than this patch that will need to be addressed. Note that since the warnings module is now implemented in C, this should be easier to deal with. Using the macros above in essence uses TLS, but through Python's PyThreadState. ---------- nosy: +nnorwitz __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2772> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com