python 2.6 can do nested context managers I think, so this could be added to the warnings context above