Apr-22-2022, 05:43 PM
Hello,
I have a simple script that waits for a queue with a timeout. I would like to catch that specific exception but cant find the correct one.
Thanks
Kind regards
I have a simple script that waits for a queue with a timeout. I would like to catch that specific exception but cant find the correct one.
import multiprocessing as mp RQ = mp.Queue() while(RUN == 1): item = None try: item = RQ.get(timeout=1) except KeyboardInterrupt: log("user break") break except XXX: item = None except: #some exception if(item != None): print(item)Now I need to know what to put in XXX to catch the queue timeout. I have tried many things I found but none worked. Note this is just a code fragment.
Thanks
Kind regards