def test_d_runtime_error(self):
    bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
    self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
    fn = script_helper.make_script(self.pkgdir, 'bing', 'import baz')
    pyc = importlib.util.cache_from_source(bazfn)
    os.rename(pyc, os.path.join(self.pkgdir, 'baz.pyc'))
    os.remove(bazfn)
    (rc, out, err) = script_helper.assert_python_failure(fn, __isolated=False)
    self.assertRegex(err, b'File "dinsdale')
def test_d_runtime_error(self):
    bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
    self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
    fn = script_helper.make_script(self.pkgdir, 'bing', 'import baz')
    pyc = importlib.util.cache_from_source(bazfn)
    os.rename(pyc, os.path.join(self.pkgdir, 'baz.pyc'))
    os.remove(bazfn)
    (rc, out, err) = script_helper.assert_python_failure(fn, __isolated=False)
    self.assertRegex(err, b'File "dinsdale')