Replace all except Exception, e with except Exception as e
Removed min_python_version=(2, 6) from import_module() invocations
Access flags.hash_randomization with getattr() because of PyPy