diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2019-07-30 15:25:11 +0000 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2019-07-30 15:25:11 +0000 |
commit | 7492b1ea07b0d74f3c5dbb38187477aab21774e8 (patch) | |
tree | dc147d924f5828991e0ce161490b77beab799333 /llvm/utils/git-svn | |
parent | 54bb5413e6526e7bf0fb75cf9d1273cf80ef86e1 (diff) | |
download | bcm5719-llvm-7492b1ea07b0d74f3c5dbb38187477aab21774e8.tar.gz bcm5719-llvm-7492b1ea07b0d74f3c5dbb38187477aab21774e8.zip |
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
Diffstat (limited to 'llvm/utils/git-svn')
-rwxr-xr-x | llvm/utils/git-svn/git-llvm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm index d4c50a5d04b..d216614de52 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) |