Skip to content

Commit cee7b34

Browse files
committed
Rewrote a condition, removing a Pyright warning
It seems Pyright does not understand `old_module` cannot be `None` when `custom_index` is `True`. The assertion seems incorrect. Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
1 parent 5ad2758 commit cee7b34

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cfbs/commands.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,11 @@ def update_command(to_update):
597597
update_objects = []
598598
for update in to_update:
599599
old_module = config.get_module_from_build(update.name)
600-
assert (
601-
old_module is not None
602-
), 'We\'ve already checked that modules are in config["build"]'
603600

604-
custom_index = old_module is not None and "index" in old_module
605-
index = Index(old_module["index"]) if custom_index else config.index
601+
if old_module is not None and "index" in old_module:
602+
index = Index(old_module["index"])
603+
else:
604+
index = config.index
606605

607606
if not old_module:
608607
index.translate_alias(update)

0 commit comments

Comments
 (0)