We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cece208 commit 351f4edCopy full SHA for 351f4ed
1 file changed
wolframclient/utils/lock.py
@@ -1,22 +1,20 @@
1
from __future__ import absolute_import, print_function, unicode_literals
2
3
-import warnings
+from wolframclient.utils.importutils import safe_import_string_and_call
4
5
try:
6
- import multithreading
7
-
8
- _lock = multithreading.Lock()
9
+ _lock = safe_import_string_and_call('multithreading.Lock')
10
def Lock():
11
return _lock
12
13
14
except (ImportError, OSError):
15
16
# JYTHON is raising an ImportError when running "import multithreading"
17
# GVisor is raising an OSError when running "multithreading.Lock()" because the feature is not implemented
18
19
from contextlib import contextmanager
+ import warnings
20
21
@contextmanager
22
0 commit comments