简体   繁体   中英

AttributeError for exception subprocess.TimeoutExpired

I have a python3 code that uses subprocess exception TimeoutExpired , but I need this to run on python2. My code is a simple try and except subprocess.TimeoutExpired but it is only available on python3. I apologise for the simplicity of the question. What can I do about this?

The timeout feature is available on Python 2.x via the subprocess32 backport of the 3.2+ subprocess module. You can get the module here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM