<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_module(self):
 """Builds a temporary module from the script file :raises exceptions.IOError: if the compilation of the script module failed """

        try:
            imp.acquire_lock()
            module_name = os.path.splitext(self.filename)[0] + str(self._script_id)

            # load module
            tmp_module = imp.new_module(module_name)

            code = compile(self.script, '%s (%s)' % (self.filename, self._script_id), 'exec')

            try:
                exec(code, tmp_module.__dict__)
            except RuntimeError as e:
                raise IOError("The compilation of the script module failed - error message: %s" % str(e))

            # return the module
            self.compiled_module = tmp_module
        finally:
            imp.release_lock()