Skip to content

Commit 3a51270

Browse files
committed
there is no need for context manager
1 parent f9ce2c3 commit 3a51270

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

wolframclient/utils/lock.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
from __future__ import absolute_import, print_function, unicode_literals
22

3-
from contextlib import contextmanager
4-
53
try:
64
import multithreading
75

86
_lock = multithreading.Lock()
97

10-
@contextmanager
118
def Lock():
12-
with _lock:
13-
yield
9+
return _lock
1410

1511

1612
except (ImportError, OSError):
1713

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
14+
# JYTHON is raising an ImportError when running "import multithreading"
15+
# GVisor is raising an OSError when running "multithreading.Lock()" because the feature is not implemented
16+
17+
from contextlib import contextmanager
2018

2119
@contextmanager
2220
def Lock():

0 commit comments

Comments
 (0)