Is the WindowsError bit necessary here? The docs for WindowsError say "The errno value maps the winerror value to corresponding errno.h values", so it should all be caught as ENOENT. But I haven't checked what error the registry lookup raises on Python 2.