Skip to content

Commit cff3535

Browse files
author
Benedikt Schmitt
committed
Merge branch 'expobrain-python2'
2 parents dfe8c4b + 1156b29 commit cff3535

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import sys
3535
import unittest
3636
import threading
37+
import errno
3738

3839
import filelock
3940

@@ -82,16 +83,20 @@ def setUp(self):
8283
"""Deletes the potential lock file at :attr:`LOCK_PATH`."""
8384
try:
8485
os.remove(self.LOCK_PATH)
85-
except FileNotFoundError:
86-
pass
86+
except OSError as e:
87+
# FileNotFound
88+
if e.errno != errno.ENOENT:
89+
raise
8790
return None
8891

8992
def tearDown(self):
9093
"""Deletes the potential lock file at :attr:`LOCK_PATH`."""
9194
try:
9295
os.remove(self.LOCK_PATH)
93-
except OSError:
94-
pass
96+
except OSError as e:
97+
# FileNotFound
98+
if e.errno != errno.ENOENT:
99+
raise
95100
return None
96101

97102
def test_simple(self):

0 commit comments

Comments
 (0)