diff mbox

python/semanage: Replace bare except with specific one

Message ID 20180710085634.5671-1-vmojzis@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Vit Mojzis July 10, 2018, 8:56 a.m. UTC
The corresponding except clause should only be used for
exceptions caused by audit module error or unavailability.

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
---
 python/semanage/seobject.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas Iooss July 14, 2018, 4:31 p.m. UTC | #1
On Tue, Jul 10, 2018 at 10:56 AM, Vit Mojzis <vmojzis@redhat.com> wrote:
> The corresponding except clause should only be used for
> exceptions caused by audit module error or unavailability.
>
> Signed-off-by: Vit Mojzis <vmojzis@redhat.com>

Thanks. I applied your two patches.

Nicolas
diff mbox

Patch

diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py
index 29b4afe0..78ffb091 100644
--- a/python/semanage/seobject.py
+++ b/python/semanage/seobject.py
@@ -140,7 +140,7 @@  try:
 
             self.log_list = []
             self.log_change_list = []
-except:
+except OSError, ImportError:
     class logger:
 
         def __init__(self):