Skip to content

Commit ea6d7c7

Browse files
committed
Fix calls
1 parent 7f24d36 commit ea6d7c7

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/manage/aliasutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def create_alias(cmd, install, alias, target, aliases_written, *, script_code=No
5050
p = cmd.global_dir / alias["name"]
5151
if not p.match("*.exe"):
5252
p = p.with_name(p.name + ".exe")
53-
target = Path(target)
53+
if not isinstance(target, Path):
54+
target = Path(target)
5455
ensure_tree(p)
5556
launcher = cmd.launcher_exe
5657
if alias.get("windowed"):

src/manage/install_command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def update_all_shortcuts(cmd, *, _create_alias=None, _cleanup_alias=None):
274274
from .aliasutils import cleanup_alias as _cleanup_alias
275275

276276
LOGGER.debug("Updating global shortcuts")
277+
aliases_written = cmd.scratch["aliasutils.create_alias.aliases_written"] = set()
277278
shortcut_written = {}
278279
for i in cmd.get_installs():
279280
if cmd.global_dir:
@@ -294,7 +295,7 @@ def update_all_shortcuts(cmd, *, _create_alias=None, _cleanup_alias=None):
294295
if not target.is_file():
295296
LOGGER.warn("Skipping alias '%s' because target '%s' does not exist", a["name"], a["target"])
296297
continue
297-
_create_alias(cmd, i, a, target)
298+
_create_alias(cmd, i, a, target, aliases_written)
298299

299300
for s in i.get("shortcuts", ()):
300301
if cmd.enable_shortcut_kinds and s["kind"] not in cmd.enable_shortcut_kinds:

tests/test_install_command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,5 @@ def create_alias(*a):
206206
assert sorted(w[2]["name"] for w in written) == ["python3.exe", "pythonw3.exe"]
207207
# Ensure we still only have the two targets
208208
assert set(w[3].name for w in written) == {"p.exe", "pw.exe"}
209-
209+
# Ensure we got an empty set passed in each time
210+
assert [w[4] for w in written] == [set()] * len(written)

0 commit comments

Comments
 (0)