import threading CURSES_LOCK = threading.RLock()