diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2024-01-04 11:15:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-04 11:15:56 +0300 |
commit | 397251ba0cc1a1df2c558c28c416b64eef73a051 (patch) | |
tree | c5bd1c25eae4d890b7f5f79d938ca5e04802bafc /modules/ui_gradio_extensions.py | |
parent | 149c9d223463c8fc34f53f26ca06e02be4c8835b (diff) | |
parent | df62ffbd2525792c115adefdbaeb7799699624b1 (diff) |
Merge pull request #14527 from akx/avoid-isfiles
Avoid unnecessary `isfile`/`exists` calls
Diffstat (limited to 'modules/ui_gradio_extensions.py')
-rw-r--r-- | modules/ui_gradio_extensions.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/ui_gradio_extensions.py b/modules/ui_gradio_extensions.py index a86c368e..f5278d22 100644 --- a/modules/ui_gradio_extensions.py +++ b/modules/ui_gradio_extensions.py @@ -35,13 +35,11 @@ def css_html(): return f'<link rel="stylesheet" property="stylesheet" href="{webpath(fn)}">'
for cssfile in scripts.list_files_with_name("style.css"):
- if not os.path.isfile(cssfile):
- continue
-
head += stylesheet(cssfile)
- if os.path.exists(os.path.join(data_path, "user.css")):
- head += stylesheet(os.path.join(data_path, "user.css"))
+ user_css = os.path.join(data_path, "user.css")
+ if os.path.exists(user_css):
+ head += stylesheet(user_css)
return head
|