diff --git a/README.md b/README.md index 43350ed..194b93e 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,13 @@ ## Automagic Snippet ```python -# https://github.com/daylinmorgan/swydd?tab=readme-ov-file#automagic-snippet -_src = (_i := __import__)("pathlib").Path(__file__).parent / "swydd/__init__.py" -if not (_i("importlib.util").util.find_spec("sywdd") or _src.is_file()): +if not ( + (_i := __import__)("importlib.util").util.find_spec("swydd") + or (_src := _i("pathlib").Path(__file__).parent / "swydd/__init__.py").is_file() +): # noqa | https://github.com/daylinmorgan/swydd?tab=readme-ov-file#automagic-snippet _r = _i("urllib.request").request.urlopen("https://swydd.dayl.in/swydd.py") _src.parent.mkdir(exist_ok=True) - _src.write_text(_r.read().decode("utf-8")) + _src.write_text(_r.read().decode()) ``` ## Alternatives