summaryrefslogtreecommitdiff
path: root/qutebrowser/utils/utils.py
diff options
context:
space:
mode:
authorAxel Dahlberg <axel.dahlberg12@gmail.com>2021-01-17 14:36:26 +0100
committerAxel Dahlberg <axel.dahlberg12@gmail.com>2021-01-17 14:40:53 +0100
commit799b0fb5c64abd6daa2887ddd7816a7ec51c343c (patch)
tree072adf2f12864ba0d153e71a162a11dec9e9fa12 /qutebrowser/utils/utils.py
parent51fa95d2582c83ea26c432203338cb6531a95ed8 (diff)
downloadqutebrowser-799b0fb5c64abd6daa2887ddd7816a7ec51c343c.tar.gz
qutebrowser-799b0fb5c64abd6daa2887ddd7816a7ec51c343c.zip
Test when cleanup_file context fails
Diffstat (limited to 'qutebrowser/utils/utils.py')
-rw-r--r--qutebrowser/utils/utils.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py
index 7cba75598..9cf68ae58 100644
--- a/qutebrowser/utils/utils.py
+++ b/qutebrowser/utils/utils.py
@@ -851,10 +851,7 @@ def cleanup_file(filepath: str) -> Iterator[None]:
yield
finally:
try:
- # TODO fail if non-existing?
- if os.path.isfile(filepath):
+ if os.path.exists(filepath):
os.remove(filepath)
except OSError as e:
- # TODO message.error?
- # message.error(f"Failed to delete tempfile {filepath} ({e})!")
log.misc.error(f"Failed to delete tempfile {filepath} ({e})!")