Ticket #3986: test_process.patch

File test_process.patch, 1.1 KB (added by truekonrads, 5 years ago)
  • twisted/test/test_process.py

    ### Eclipse Workspace Patch 1.0
    #P Twisted
     
    77 
    88import gzip 
    99import os 
    10 import popen2 
    1110import sys 
    1211import signal 
    1312import StringIO 
     
    23302329    FDTest.skip = skipMessage 
    23312330else: 
    23322331    # do this before running the tests: it uses SIGCHLD and stuff internally 
    2333     lsOut = popen2.popen3("/bin/ls ZZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")[2].read() 
     2332    cmd = "/bin/ls ZZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 
     2333    try: 
     2334        from subprocess import Popen, PIPE 
     2335        p = Popen(cmd, shell=True, 
     2336          stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True) 
     2337        child_stderr = p.stderr 
     2338    except ImportError: 
     2339        import popen2 
     2340        child_stderr = popen2.popen3(cmd)[2] 
     2341 
     2342    lsOut = child_stderr.read() 
    23342343 
    23352344if (runtime.platform.getType() != 'win32') or (not interfaces.IReactorProcess(reactor, None)): 
    23362345    Win32ProcessTestCase.skip = skipMessage