From d1187ac5464fd5896361d4f1c8a9ed91c9e54b57 Mon Sep 17 00:00:00 2001 From: William Turner Date: Sun, 17 Mar 2019 16:21:59 -0400 Subject: [PATCH] Workaround lack of multiprocessing on Jython --- tqdm/_tqdm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tqdm/_tqdm.py b/tqdm/_tqdm.py index 621c5634..b8c198a8 100755 --- a/tqdm/_tqdm.py +++ b/tqdm/_tqdm.py @@ -21,7 +21,6 @@ from numbers import Number from time import time from contextlib import contextmanager # For parallelism safety -import multiprocessing as mp import threading as th from warnings import warn @@ -104,7 +103,8 @@ class TqdmDefaultWriteLock(object): def create_mp_lock(cls): if not hasattr(cls, 'mp_lock'): try: - cls.mp_lock = mp.RLock() # multiprocessing lock + from multiprocessing import RLock + cls.mp_lock = RLock() # multiprocessing lock except ImportError: # pragma: no cover cls.mp_lock = None except OSError: # pragma: no cover