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