Previously, when sepolicy was run without any argument, the usage message with the error "too few arguments" was shown. Using Python 3 it threw a traceback. This patch unifies behavior on Py2 and Py3 so that sepolicy shows the help message in this case. Fixes: Traceback (most recent call last): File "/usr/bin/sepolicy", line 647, in <module> args.func(args) AttributeError: 'Namespace' object has no attribute 'func' Signed-off-by: Petr Lautrbach <plautrba@xxxxxxxxxx> --- policycoreutils/sepolicy/sepolicy.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/policycoreutils/sepolicy/sepolicy.py b/policycoreutils/sepolicy/sepolicy.py index 08a5c2f..7d57f6e 100755 --- a/policycoreutils/sepolicy/sepolicy.py +++ b/policycoreutils/sepolicy/sepolicy.py @@ -685,9 +685,12 @@ if __name__ == '__main__': try: if os.path.basename(sys.argv[0]) == "sepolgen": - args = parser.parse_args(["generate"] + sys.argv[1:]) + parser_args = [ "generate" ] + sys.argv[1:] + elif len(sys.argv) > 1: + parser_args = sys.argv[1:] else: - args = parser.parse_args() + parser_args = ["-h"] + args = parser.parse_args(args=parser_args) args.func(args) sys.exit(0) except ValueError, e: -- 2.6.2 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.