Skip to content

Commit 52c301a

Browse files
author
Benedikt Schmitt
committed
Merge branch 'spokorski-master'
2 parents f4d074d + 5b962cc commit 52c301a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

filelock.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ def _release(self):
395395
self._lock_file_fd = None
396396
fcntl.flock(fd, fcntl.LOCK_UN)
397397
os.close(fd)
398+
399+
try:
400+
os.remove(self._lock_file)
401+
except OSError:
402+
pass
398403
return None
399404

400405
# Soft lock

test.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
import filelock
3939

4040

41+
PY2 = sys.version_info[0] == 2
42+
PY3 = sys.version_info[0] == 3
43+
44+
4145
class ExThread(threading.Thread):
4246

4347
def __init__(self, *args, **kargs):
@@ -55,8 +59,11 @@ def run(self):
5559
def join(self):
5660
threading.Thread.join(self)
5761
if self.ex is not None:
58-
wrapper_ex = self.ex[1]
59-
raise (wrapper_ex.__class__, wrapper_ex, self.ex[2])
62+
if PY3:
63+
raise self.ex[0].with_traceback(self.ex[1], self.ex[2])
64+
elif PY2:
65+
wrapper_ex = self.ex[1]
66+
raise (wrapper_ex.__class__, wrapper_ex, self.ex[2])
6067
return None
6168

6269

0 commit comments

Comments
 (0)