Skip to content

Commit 6885e3a

Browse files
committed
Puppeteer abspath_handler: guard _refresh_symlink when bin_dir is None
Devin caught the parity bug I introduced: ``_refresh_symlink`` asserts ``bin_dir is not None``, but in global/unmanaged mode (``install_root=None``) ``bin_dir`` is ``None`` and the ``except OSError`` doesn't catch the resulting ``AssertionError`` — crashing ``default_abspath_handler`` instead of returning the resolved path. Add the same early-return guard ``PlaywrightProvider`` already has: when ``bin_dir`` is ``None`` we return ``resolved`` directly without attempting a shim refresh.
1 parent 1788b18 commit 6885e3a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

abxpkg/binprovider_puppeteer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,12 @@ def default_abspath_handler(
430430

431431
# Refresh the convenience shim under ``bin_dir`` so ``PATH`` users
432432
# get a stable entry pointing at the freshly-resolved executable.
433-
# Fall back to the resolved path directly when the shim refresh
434-
# fails (read-only FS etc.).
433+
# In global/unmanaged mode (``install_root=None``) we have no
434+
# managed shim dir, so just return the resolved path directly.
435+
# When the shim refresh fails (read-only FS etc.) we also fall
436+
# back to the resolved path.
437+
if self.bin_dir is None:
438+
return resolved
435439
try:
436440
return self._refresh_symlink(str(bin_name), resolved)
437441
except OSError:

0 commit comments

Comments
 (0)