Extract exception filter class resolution to a separate method. Don't import module 'exceptions' in unit test because it breaks compatibility with Python3