From 2bd70c4fe887b03d558a646c30677046d83c10c0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 24 Jun 2017 22:06:02 +0300 Subject: Fix: avoid bare "except:" statements --- obnamlib/encryption.py | 2 +- obnamlib/plugins/fuse_plugin.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py index 0104c11c..8eb2896a 100644 --- a/obnamlib/encryption.py +++ b/obnamlib/encryption.py @@ -94,7 +94,7 @@ def _gpg_pipe(args, data, passphrase, gpghome=None): try: out = _gpg(args + ['--passphrase-fd', str(keypipe[0])], stdin=data, gpghome=gpghome) - except: # pragma: no cover + except BaseException: # pragma: no cover os.close(keypipe[0]) raise diff --git a/obnamlib/plugins/fuse_plugin.py b/obnamlib/plugins/fuse_plugin.py index 97025dfb..3e505d0f 100644 --- a/obnamlib/plugins/fuse_plugin.py +++ b/obnamlib/plugins/fuse_plugin.py @@ -104,7 +104,7 @@ class ObnamFuseFile(object): try: self.metadata = self.fuse_fs.get_metadata_in_generation(path) - except: + except BaseException: logging.error('Unexpected exception', exc_info=True) raise @@ -342,7 +342,7 @@ class ObnamFuse(fuse.Fuse): return self.get_stat_in_generation(path) except obnamlib.ObnamError: raise IOError(errno.ENOENT, 'No such file or directory') - except: + except BaseException: logging.error('Unexpected exception', exc_info=True) raise @@ -360,7 +360,7 @@ class ObnamFuse(fuse.Fuse): return [fuse.Direntry(name) for name in ['.', '..'] + listdir] except obnamlib.ObnamError: raise IOError(errno.EINVAL, 'Invalid argument') - except: + except BaseException: logging.error('Unexpected exception', exc_info=True) raise @@ -376,7 +376,7 @@ class ObnamFuse(fuse.Fuse): raise IOError(errno.EINVAL, 'Invalid argument') except obnamlib.ObnamError: raise IOError(errno.ENOENT, 'No such file or directory') - except: + except BaseException: logging.error('Unexpected exception', exc_info=True) raise @@ -449,7 +449,7 @@ class ObnamFuse(fuse.Fuse): return value except obnamlib.ObnamError: raise IOError(errno.ENOENT, 'No such file or directory') - except: + except BaseException: logging.error('Unexpected exception', exc_info=True) raise @@ -480,7 +480,7 @@ class ObnamFuse(fuse.Fuse): return name_blob.split('\0')[:-1] except obnamlib.ObnamError: raise IOError(errno.ENOENT, 'No such file or directory') - except: + except BaseException: logging.error('Unexpected exception', exc_info=True) raise -- cgit v1.2.1