Installation fails with NameError if SandboxViolation is raised

If ``SandboxViolation`` is raised during installation, the fix for issue #3160 results in a NameError because the ``tmp`` variable was never assigned. This corrects the NameError and lets installation proceed.