MCPcopy Index your code
hub / github.com/ray-project/ray / patch_isdir

Function patch_isdir

python/setup.py:459–476  ·  view source on GitHub ↗

Python on Windows is having hard times at telling if a symlink is a directory - it can "guess" wrong at times, which bites when finding packages. Replace with a fixed version which unwraps links first.

()

Source from the content-addressed store, hash-verified

457
458
459def patch_isdir():
460 """
461 Python on Windows is having hard times at telling if a symlink is
462 a directory - it can "guess" wrong at times, which bites when
463 finding packages. Replace with a fixed version which unwraps links first.
464 """
465 orig_isdir = os.path.isdir
466
467 def fixed_isdir(path):
468 while os.path.islink(path):
469 try:
470 link = os.readlink(path)
471 except OSError:
472 break
473 path = os.path.abspath(os.path.join(os.path.dirname(path), link))
474 return orig_isdir(path)
475
476 os.path.isdir = fixed_isdir
477
478
479def replace_symlinks_with_junctions():

Callers 1

setup.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…