Fix raising AttributeError from patcher.stop()