'Internal function used by run_sqlmap and run_sqlmap_with_pipes to
call subprocess.
:return: A Popen object.'

def _run(self, custom_params):

    if (not os.path.exists(self.OUTPUT_DIR)):
        os.mkdir(self.OUTPUT_DIR)
    (cwd, base_args) = self._get_base_args()
    final_params = self.get_wrapper_params(custom_params)
    target_params = self.target.to_params()
    all_params = ((base_args + final_params) + target_params)
    if self.debug:
        all_params += self.DEBUG_ARGS
    try:
        process = subprocess.Popen(args=all_params, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, universal_newlines=True, cwd=cwd)
    except OSError as os_err:
        if (os_err.errno == errno.ENOMEM):
            msg = 'The    operating    system    is    running    low    on    memory    and    failed    to    start    the    sqlmap    process.'
            om.out.error(msg)
            self.last_command = None
            return None
        else:
            raise
    else:
        full_command = '    '.join(all_params)
        self.last_command = full_command
        return process
