Merge pull request #19537 from gnossen/terminate_bazel_hack

Terminate bazel hack
pull/13465/head
Richard Belleville 5 years ago committed by GitHub
commit 9caf5d32b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/python/grpcio_tests/tests/bazel_namespace_package_hack.py

@ -24,9 +24,12 @@ import sys
# Analysis in depth: https://github.com/bazelbuild/rules_python/issues/55 # Analysis in depth: https://github.com/bazelbuild/rules_python/issues/55
def sys_path_to_site_dir_hack(): def sys_path_to_site_dir_hack():
"""Add valid sys.path item to site directory to parse the .pth files.""" """Add valid sys.path item to site directory to parse the .pth files."""
items = []
for item in sys.path: for item in sys.path:
if os.path.exists(item): if os.path.exists(item):
# The only difference between sys.path and site-directory is # The only difference between sys.path and site-directory is
# whether the .pth file will be parsed or not. A site-directory # whether the .pth file will be parsed or not. A site-directory
# will always exist in sys.path, but not another way around. # will always exist in sys.path, but not another way around.
site.addsitedir(item) items.append(item)
for item in items:
site.addsitedir(item)

Loading…
Cancel
Save