Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: support/
Date: Tue, 26 Mar 2019 10:17:41
Message-Id: 1553508325.6b260827b085206d6796b69a48f931ddb2c0c328.perfinion@gentoo
1 commit: 6b260827b085206d6796b69a48f931ddb2c0c328
2 Author: Chris PeBenito <Christopher.PeBenito <AT> microsoft <DOT> com>
3 AuthorDate: Fri Mar 15 13:25:00 2019 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 25 10:05:25 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=6b260827
7
8 genhomedircon.py: Fix top-level exception handling.
9
10 Fixes errors like this:
11
12 Traceback (most recent call last):
13 File "support/genhomedircon.py", line 490, in <module>
14 errorExit("Options Error " + error)
15 TypeError: Can't convert 'GetoptError' object to str implicitly
16
17 Signed-off-by: Chris PeBenito <Christopher.PeBenito <AT> microsoft.com>
18 Signed-off-by: Jason Zaman <jason <AT> perfinion.com>
19
20 support/genhomedircon.py | 8 ++------
21 1 file changed, 2 insertions(+), 6 deletions(-)
22
23 diff --git a/support/genhomedircon.py b/support/genhomedircon.py
24 index 6662f412..3503fb4a 100644
25 --- a/support/genhomedircon.py
26 +++ b/support/genhomedircon.py
27 @@ -486,9 +486,5 @@ try:
28 selconf=selinuxConfig(directory, setype, usepwd)
29 selconf.write()
30
31 -except getopt.error as error:
32 - errorExit("Options Error " + error)
33 -except ValueError as error:
34 - errorExit("ValueError " + error)
35 -except IndexError:
36 - errorExit("IndexError")
37 +except Exception as error:
38 + errorExit(error)