diff options
Diffstat (limited to 'tools/distrib/python/check_grpcio_tools.py')
-rwxr-xr-x | tools/distrib/python/check_grpcio_tools.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/distrib/python/check_grpcio_tools.py b/tools/distrib/python/check_grpcio_tools.py index c5afa713e6..b56ccaea7a 100755 --- a/tools/distrib/python/check_grpcio_tools.py +++ b/tools/distrib/python/check_grpcio_tools.py @@ -14,17 +14,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cStringIO - -import make_grpcio_tools as make +import make_grpcio_tools as _make OUT_OF_DATE_MESSAGE = """file {} is out of date Have you called tools/distrib/python/make_grpcio_tools.py since upgrading protobuf?""" -check_protoc_lib_deps_content = make.get_deps() +submodule_commit_hash = _make.protobuf_submodule_commit_hash() + +with open(_make.GRPC_PYTHON_PROTOC_LIB_DEPS, 'r') as _protoc_lib_deps_file: + content = _protoc_lib_deps_file.read().splitlines() + +testString = (_make.COMMIT_HASH_PREFIX + + submodule_commit_hash + + _make.COMMIT_HASH_SUFFIX) -with open(make.GRPC_PYTHON_PROTOC_LIB_DEPS, 'r') as protoc_lib_deps_file: - if protoc_lib_deps_file.read() != check_protoc_lib_deps_content: - print(OUT_OF_DATE_MESSAGE.format(make.GRPC_PYTHON_PROTOC_LIB_DEPS)) - raise SystemExit(1) +if testString not in content: + print(OUT_OF_DATE_MESSAGE.format(_make.GRPC_PYTHON_PROTOC_LIB_DEPS)) + raise SystemExit(1) |