def _test_non_code_marshal(self, *, del_source=False):
    with util.create_modules('_temp') as mapping:
        bytecode_path = self.manipulate_bytecode('_temp', mapping, (lambda bc: (bc[:16] + marshal.dumps(b'abcd'))), del_source=del_source)
        file_path = (mapping['_temp'] if (not del_source) else bytecode_path)
        with self.assertRaises(ImportError) as cm:
            self.import_(file_path, '_temp')
        self.assertEqual(cm.exception.name, '_temp')
        self.assertEqual(cm.exception.path, bytecode_path)
def _test_non_code_marshal(self, *, del_source=False):
    with util.create_modules('_temp') as mapping:
        bytecode_path = self.manipulate_bytecode('_temp', mapping, (lambda bc: (bc[:16] + marshal.dumps(b'abcd'))), del_source=del_source)
        file_path = (mapping['_temp'] if (not del_source) else bytecode_path)
        with self.assertRaises(ImportError) as cm:
            self.import_(file_path, '_temp')
        self.assertEqual(cm.exception.name, '_temp')
        self.assertEqual(cm.exception.path, bytecode_path)