From: Mehdi Amini Date: Tue, 30 Jul 2019 15:25:11 +0000 (+0000) Subject: Fix `git llvm` script when no arguments are supplied on Python 3 X-Git-Tag: llvmorg-11-init~13290 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7492b1ea07b0d74f3c5dbb38187477aab21774e8;p=platform%2Fupstream%2Fllvm.git Fix `git llvm` script when no arguments are supplied on Python 3 Instead of displaying a help message, it was issuing an error message: AttributeError: 'Namespace' object has no attribute 'func' https://bugs.python.org/issue16308 has more information on the bug. llvm-svn: 367320 --- diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm index d4c50a5..d216614d 100755 --- a/llvm/utils/git-svn/git-llvm +++ b/llvm/utils/git-svn/git-llvm @@ -617,5 +617,14 @@ if __name__ == '__main__': VERBOSE = args.verbose QUIET = args.quiet + # Python3 workaround, for when not arguments are provided. + # See https://bugs.python.org/issue16308 + try: + func = args.func + except AttributeError: + # No arguments or subcommands were given. + parser.print_help() + parser.exit() + # Dispatch to the right subcommand args.func(args)