8000 Reword the timeout error message in cbook._lock_path. · matplotlib/matplotlib@bfede46 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfede46

Browse files
committed
Reword the timeout error message in cbook._lock_path.
1) Lock files are specific files now, not globs of directories. 2) Format the path with `{}`, not `{!r}` as _lock_path is passing a Path object but we don't want the error message to say "PosixPath('foo')", just "foo". The previously used `_lockstr` will go away at the same time the deprecated `Locked` is removed.
1 parent 9ec4b95 commit bfede46

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,12 @@ def _lock_path(path):
19251925
except FileExistsError:
19261926
time.sleep(sleeptime)
19271927
else:
1928-
raise TimeoutError(_lockstr.format(lock_path))
1928+
raise TimeoutError("""\
1929+
Lock error: Matplotlib failed to acquire the following lock file:
1930+
{}
1931+
This maybe due to another process holding this lock file. If you are sure no
1932+
other Matplotlib process is running, remove this file and try again.""".format(
1933+
lock_path))
19291934
try:
19301935
yield
19311936
finally:

0 commit comments

Comments
 (0)
0