Do not let the failed-import cache pin caller stacks

``file_from_module_name`` caches failed imports in ``_mod_file_cache`` and
raises the cached exception instance directly. Clearing ``__traceback__``
right before the ``raise`` does nothing: Python attaches a fresh traceback
to the object as it propagates, so the cache ends up holding the whole
caller stack, and every later cache hit re-pins a new one.

Raise a copy instead, leaving the cached instance traceback-free.

The sibling strip on ``error=e.with_traceback(None)`` is kept: that one is
effective, since the ``ImportError`` it clears is stored rather than raised.

Refs #1780, refs #792
3 files changed