-4

subprocess モジュールを使用して popen2 を置き換えるには、このコードをどのように修正すればよいですか?

popen3 = popen2.Popen3(cmd, capturestderr=True)     
rc = popen3.wait()
if os.WIFEXITED(rc):
    rc = os.WEXITSTATUS(rc) 
        if rc < 0:
            #""" Needed to make sure that catastrophic errors are not processed here, hence the rc check.
            #"""                                             
            if len(stderr) > 0:
                inserts= []
                inserts.append("Warnings occurred during run of %s" % self.__MODULE_NAME )
                inserts.append("Check conversion parameters.")
                #self.msgWrite( "98000001", inserts )

        if rc == 0:
    self.msgDebug("CompartService exited normally", "Exit code with signal: %s" % str(rc))
    #
4

1 に答える 1