This should soon be unnecessary as it is being fixed in https://github.com/rapid7/metasploit-framework/pull/2939