diff options
Diffstat (limited to 'tools/distrib/python/grpcio_tools/grpc_tools/protoc.py')
-rw-r--r-- | tools/distrib/python/grpcio_tools/grpc_tools/protoc.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py b/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py index efad51e07b..582cba0e39 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py +++ b/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py @@ -19,16 +19,18 @@ import sys from grpc_tools import _protoc_compiler + def main(command_arguments): - """Run the protocol buffer compiler with the given command-line arguments. + """Run the protocol buffer compiler with the given command-line arguments. Args: command_arguments: a list of strings representing command line arguments to `protoc`. """ - command_arguments = [argument.encode() for argument in command_arguments] - return _protoc_compiler.run_main(command_arguments) + command_arguments = [argument.encode() for argument in command_arguments] + return _protoc_compiler.run_main(command_arguments) + if __name__ == '__main__': - proto_include = pkg_resources.resource_filename('grpc_tools', '_proto') - sys.exit(main(sys.argv + ['-I{}'.format(proto_include)])) + proto_include = pkg_resources.resource_filename('grpc_tools', '_proto') + sys.exit(main(sys.argv + ['-I{}'.format(proto_include)])) |