if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG, format=
        '%(asctime)s:  %(message)s', datefmt='%H:%M:%S')
result = mp.Queue()
proc = mp.Process(target=abc, args=('some_pattern to match', result))
proc.start()
proc.join(timeout=5)
if proc.is_alive():
    proc.terminate()
else:
    pass
How to return from function if got stuck for 90 seconds?