Skip to content

Commit 5d059e2

Browse files
committed
refactor: simplify finding spec or pkg
1 parent 90b03f5 commit 5d059e2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

shiny/ui/_theme.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,7 @@ def check_is_valid_preset(preset: str | None) -> ShinyThemePreset:
568568
def check_theme_pkg_installed(pkg: str, spec: str | None = None) -> None:
569569
import importlib.util
570570

571-
if spec is None:
572-
spec = pkg
573-
574-
if importlib.util.find_spec(spec) is None:
571+
if importlib.util.find_spec(spec or pkg) is None:
575572
raise ImportError(
576573
f"The '{pkg}' package is required to compile custom themes. "
577574
'Please install it with `pip install {pkg}` or `pip install "shiny[theme]"`.',

0 commit comments

Comments
 (0)