Skip to content

Commit 76bd4cc

Browse files
fix linting
1 parent aca5eeb commit 76bd4cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/_pytest/tmpdir.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def _max(iterable, default):
3131

3232

3333
def make_numbered_dir(root, prefix):
34-
3534
def parse_num(p, cut=len(prefix)):
3635
maybe_num = p.name[cut:]
3736
try:
@@ -53,11 +52,13 @@ def parse_num(p, cut=len(prefix)):
5352
else:
5453
raise EnvironmentError(
5554
"could not create numbered dir with prefix {prefix} in {root})".format(
56-
prefix=prefix, root=root))
55+
prefix=prefix, root=root
56+
)
57+
)
5758

5859

5960
def create_cleanup_lock(p):
60-
lock_path = p.joinpath('.lock')
61+
lock_path = p.joinpath(".lock")
6162
fd = os.open(str(lock_path), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644)
6263
pid = os.getpid()
6364
spid = str(pid)
@@ -82,6 +83,7 @@ def cleanup_on_exit(lock_path=lock_path, original_pid=pid):
8283
lock_path.unlink()
8384
except (OSError, IOError):
8485
pass
86+
8587
return atexit.register(cleanup_on_exit)
8688

8789

@@ -96,14 +98,12 @@ def make_numbered_dir_with_cleanup(root, prefix, keep, consider_lock_dead_after)
9698
p = make_numbered_dir(root, prefix)
9799
lock_path = create_cleanup_lock(p)
98100
register_cleanup_lock_removal(lock_path)
99-
except Exception as e:
101+
except Exception:
100102
raise
101103
else:
102104
cleanup_numbered_dir(root=root, prefix=prefix, keep=keep)
103105
return p
104106

105-
else:
106-
raise e
107107

108108
@attr.s
109109
class TempPathFactory(object):

0 commit comments

Comments
 (0)