f6ca926
@@ -341,13 +341,14 @@
args = parser.parse_args()
- try:
- args.func(args)
- except AttributeError:
+ if not hasattr(args, 'func'):
# if func attribute is missing, no command was specified, print help and exit
parser.print_help()
sys.exit(1)
+ # run the requested command
+ args.func(args)
+
if __name__ == '__main__':
exit = main()
The way it was written, it consumed all AttributeErrors that happened anywhere in the project, and exited the program (with a cmdline help message) without printing any traceback. Now it prints the error as it should.
lgtm
Commit d11a4b2 fixes this pull-request
Pull-Request has been merged by kparal
The way it was written, it consumed all AttributeErrors that happened anywhere
in the project, and exited the program (with a cmdline help message) without
printing any traceback. Now it prints the error as it should.