Aug-25-2021, 11:04 PM
Quote:Changed in version 3.7: Added the text parameter, as a more understandable alias of universal_newlines. Added the capture_output parameter.
Looks like
capture_output
becomes available in 3.7. You should consider using a more current release.For earlier versions I think you can just open stdout/stderr directly....
import subprocess try: subprocess.call("net use U: "+"\\\\"+itm+"\\c$\\SMTS\\TDR_Logs", shell=True, timeout=10, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) except subprocess.TimeoutExpired: print(f"Server {itm} took too long to mount. Skipping...") continue #or break or return or whatever appropriate to go to the next server....