Wow, this is ugly :)

So - I believe this should be properly fixed up stream - http://bugs.python.org/issue19746 as referenced in the docstring here.

Doing this poking under the hood is fragile - I suspect we'll need a bunch of careful logic to work with different releases of Python.