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.
()
| 457 | |
| 458 | |
| 459 | def 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 | |
| 479 | def replace_symlinks_with_junctions(): |
no outgoing calls
no test coverage detected
searching dependent graphs…