Show More
@@ -18,6 +18,7 b' This file is only meant to be imported by process.py, not by end-users.' | |||
|
18 | 18 | import os |
|
19 | 19 | import sys |
|
20 | 20 | import ctypes |
|
21 | import time | |
|
21 | 22 | |
|
22 | 23 | from ctypes import c_int, POINTER |
|
23 | 24 | from ctypes.wintypes import LPCWSTR, HLOCAL |
@@ -104,10 +105,11 b' def _system_body(p):' | |||
|
104 | 105 | # wait() isn't interruptible (https://bugs.python.org/issue28168) so poll in |
|
105 | 106 | # a loop instead of just doing `return p.wait()`. |
|
106 | 107 | while True: |
|
107 | try: | |
|
108 | return p.wait(0.01) | |
|
109 | except TimeoutExpired: | |
|
110 |
|
|
|
108 | result = p.poll() | |
|
109 | if result is None: | |
|
110 | time.sleep(0.01) | |
|
111 | else: | |
|
112 | return result | |
|
111 | 113 | |
|
112 | 114 | |
|
113 | 115 | def system(cmd): |
General Comments 0
You need to be logged in to leave comments.
Login now