We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 127086d commit 37b7865Copy full SHA for 37b7865
1 file changed
BlocksScreen/devices/storage/udisks2.py
@@ -570,8 +570,12 @@ def _cleanup_legacy_dir(self) -> None:
570
"""Removes legacy directory that contained symlinks
571
for all mounted USB devices on the machine
572
"""
573
- legacy_dir = self.gcodes_path.joinpath("USB")
574
- if legacy_dir.is_dir() and not (
575
- legacy_dir.is_symlink() or legacy_dir.is_file()
576
- ):
577
- shutil.rmtree(legacy_dir)
+ try:
+ legacy_dir = self.gcodes_path.joinpath("USB")
+ if legacy_dir.is_dir() and not (
+ legacy_dir.is_symlink() or legacy_dir.is_file()
+ ):
578
+ shutil.rmtree(legacy_dir)
579
+ except Exception:
580
+ logging.debug("Failed to remove legacy dir")
581
+ return
0 commit comments