1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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
This commit is contained in:
Mehdi Amini 2019-07-30 15:25:11 +00:00
parent 617419d925
commit 323897e9ec

View File

@ -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)