From e4ead4bec025dbebebbdd3848e11a2bdeca25ab9 Mon Sep 17 00:00:00 2001 From: nanahpang <31627465+nanahpang@users.noreply.github.com> Date: Tue, 4 Aug 2020 13:51:23 -0700 Subject: [PATCH] Update docgen.py Fix a RexAnalyzer error during the import, and update in github as well. Parentheses around a single item in Python has no effect: (foo) is exactly equivalent to foo. In many cases this is harmless, but it can suggest a subtle bug when used in string formatting. A '%'-formatted string with a single format specifier can be formatted using a single value or a one element tuple: 'hello %s' % name or 'hello %s' % (name,). Consequently, a line like error_msg = 'Cannot process %s' % (data) may leave code reviewers and future readers unsure if there is a subtle bug if data is a tuple. Since the args.repo_owner here is a single string, drop the parentheses is better. --- tools/distrib/python/docgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/distrib/python/docgen.py b/tools/distrib/python/docgen.py index 0fc49a1d21c..d5bd4a1a7b8 100755 --- a/tools/distrib/python/docgen.py +++ b/tools/distrib/python/docgen.py @@ -91,7 +91,7 @@ else: subprocess.check_call(['git', 'checkout', '-b', doc_branch], cwd=repo_dir) subprocess.check_call([ 'git', 'remote', 'add', 'ssh-origin', - 'git@github.com:%s/grpc.git' % (args.repo_owner) + 'git@github.com:%s/grpc.git' % args.repo_owner ], cwd=repo_dir) print('Updating documentation...')