Idlelib: forward port changes that silenced 2.7 -3 deprecation warnings and
which are at least as efficient. On Py3, unpacking exceptions never works.