mirror of
https://github.com/libfuse/libfuse.git
synced 2026-07-07 14:47:41 +08:00
Fix BaseException catch in test files
Replace bare except clauses with 'except Exception' to avoid catching system-exiting exceptions like KeyboardInterrupt and SystemExit, which should not be suppressed. Fixes: GitHub CodeQL Alerts #15, #16, #17 Rule: py/catch-base-exception Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
This commit is contained in:
+2
-2
@@ -105,7 +105,7 @@ def test_notify1(tmpdir, name, notify, output_checker):
|
||||
try:
|
||||
umount(mount_process, mnt_dir)
|
||||
logger.debug("Umount disabled")
|
||||
except:
|
||||
except Exception:
|
||||
logger.error(f"Failure in unmount: '{' '.join(cmdline)}'")
|
||||
cleanup(mount_process, mnt_dir)
|
||||
logger.debug("Unmount completed")
|
||||
@@ -148,7 +148,7 @@ def test_notify_file_size(tmpdir, notify, output_checker):
|
||||
else:
|
||||
try:
|
||||
umount(mount_process, mnt_dir)
|
||||
except:
|
||||
except Exception:
|
||||
logger.error(f"Failure in unmount: '{' '.join(cmdline)}'")
|
||||
cleanup(mount_process, mnt_dir)
|
||||
logger.debug("Unmount completed")
|
||||
|
||||
+1
-1
@@ -250,7 +250,7 @@ os.environ['PATH'] = '%s:%s' % (pjoin(basename, 'example'), os.environ['PATH'])
|
||||
|
||||
try:
|
||||
(fuse_proto, fuse_caps) = get_printcap()
|
||||
except:
|
||||
except Exception:
|
||||
# Rely on test to raise error
|
||||
fuse_proto = (0,0)
|
||||
fuse_caps = set()
|
||||
|
||||
Reference in New Issue
Block a user