def run(self):
    debug("Running: " + str(self.cmd))
    if sublime.platform() == "windows":
      closeFDs = False
    else:
      closeFDs = True

    self.proc = subprocess.Popen(self.cmd, bufsize=0, close_fds=closeFDs, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

    while self.proc.poll() is None:
        try:
          data = self.proc.stdout.readline().decode('UTF-8')
          # this isn't the same as "print()": sys.stdout.write(data)
          # print("Read: " + data)
          console_output(data)
        except __HOLE__ as e:
          break  # we get this when the child process has terminated
        except Exception as e:
          console_output("Exception reading from coprocess: "+str(e))

    on_main_thread(lambda: self.completionCallback(self.threadID, self.window))

    debug("CoronaSubprocessThread: ends (proc.poll(): " + str(self.proc.poll()) + ")")
dataset/ETHPy150Open coronalabs/CoronaSDK-SublimeText/debugger.py/CoronaSubprocessThread.run