]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
utils: Tweak exception handling to stop flake8 complaining
authorMartin Schwenke <martin@meltin.net>
Tue, 27 Apr 2021 04:56:20 +0000 (14:56 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 20 Jul 2021 04:43:37 +0000 (04:43 +0000)
Don't bother with "as e" to avoid warning about unused variable.
Don't use bare "except:" (though pylint still complains about this
version).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
ctdb/utils/etcd/ctdb_etcd_lock

index 2cd6e4d76ba9d6350be6f07555ad5508cd3b0e20..7d7f9411ad5054b4a71d45a9589cdb031a8892c9 100755 (executable)
@@ -196,10 +196,10 @@ def main():
                 break
             os.kill(ppid, 0)
             time.sleep(etcd_config['lock_refresh'])
-    except (OSError, SystemExit) as e:
+    except (OSError, SystemExit):
         if lock is not None and lock.is_acquired:
             lock.release()
-    except:
+    except Exception:
         print_nonl(3)
         if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
             raise