

def run(self):
    try:
        if (not os.path.isdir(self.working_dir)):
            return
        if (self.working_dir != ''):
            os.chdir(self.working_dir)
        startupinfo = None
        if (os.name == 'nt'):
            startupinfo = subprocess.STARTUPINFO()
            startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        proc = subprocess.Popen(self.command, stdout=self.stdout, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, startupinfo=startupinfo, shell=False, universal_newlines=False)
        output = proc.communicate(self.stdin)[0]
        if (not output):
            output = ''
        main_thread(self.on_done, _make_text_safeish(output, self.fallback_encoding), **self.kwargs)
    except subprocess.CalledProcessError as e:
        main_thread(self.on_done, e.returncode)
    except OSError as e:
        if (e.errno == 2):
            main_thread(sublime.error_message, ('Git binary could not be found in PATH\n\nConsider using the git_command setting for the Git plugin\n\nPATH is: %s' % os.environ['PATH']))
        else:
            raise e

dataset/ETHPy150Open JT5D/Alfred-Popclip-Sublime/Sublime Text 2/sublime-github/lib/git.py CommandThread.run/original