commit:     6b260827b085206d6796b69a48f931ddb2c0c328
Author:     Chris PeBenito <Christopher.PeBenito <AT> microsoft <DOT> com>
AuthorDate: Fri Mar 15 13:25:00 2019 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Mon Mar 25 10:05:25 2019 +0000
URL:        
https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=6b260827

genhomedircon.py: Fix top-level exception handling.

Fixes errors like this:

Traceback (most recent call last):
  File "support/genhomedircon.py", line 490, in <module>
    errorExit("Options Error " + error)
TypeError: Can't convert 'GetoptError' object to str implicitly

Signed-off-by: Chris PeBenito <Christopher.PeBenito <AT> microsoft.com>
Signed-off-by: Jason Zaman <jason <AT> perfinion.com>

 support/genhomedircon.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/support/genhomedircon.py b/support/genhomedircon.py
index 6662f412..3503fb4a 100644
--- a/support/genhomedircon.py
+++ b/support/genhomedircon.py
@@ -486,9 +486,5 @@ try:
        selconf=selinuxConfig(directory, setype, usepwd)
        selconf.write()
 
-except getopt.error as error:
-       errorExit("Options Error " + error)
-except ValueError as error:
-       errorExit("ValueError " + error)
-except IndexError:
-       errorExit("IndexError")
+except Exception as error:
+       errorExit(error)

Reply via email to