1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00

refactor: use walrus

This commit is contained in:
coletdjnz 2025-02-23 08:58:30 +13:00
parent b4ba18f913
commit 80f8fa771c
No known key found for this signature in database
GPG key ID: 91984263BB39894A

View file

@ -168,8 +168,7 @@ def invalidate_caches(self):
def directories(): def directories():
with contextlib.suppress(ModuleNotFoundError): with contextlib.suppress(ModuleNotFoundError):
spec = importlib.util.find_spec(PACKAGE_NAME) if spec := importlib.util.find_spec(PACKAGE_NAME):
if spec:
return list(spec.submodule_search_locations) return list(spec.submodule_search_locations)
return [] return []