aboutsummaryrefslogtreecommitdiffstats
path: root/modules/styles.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-31 04:38:34 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-08-31 04:38:34 +0000
commit5ef669de080814067961f28357256e8fe27544f4 (patch)
tree655f4582e692f0fc3667b3b668ad365ac3ab92ae /modules/styles.py
parentc9c8485bc1e8720aba70f029d25cba1c4abf2b5c (diff)
parente7965a5eb804a51e949df07c66c0b7c61ab7fa7b (diff)
downloadstable-diffusion-webui-gfx803-5ef669de080814067961f28357256e8fe27544f4.tar.gz
stable-diffusion-webui-gfx803-5ef669de080814067961f28357256e8fe27544f4.tar.bz2
stable-diffusion-webui-gfx803-5ef669de080814067961f28357256e8fe27544f4.zip
Merge branch 'release_candidate'
Diffstat (limited to 'modules/styles.py')
-rw-r--r--modules/styles.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/styles.py b/modules/styles.py
index ec0e1bc5..0740fe1b 100644
--- a/modules/styles.py
+++ b/modules/styles.py
@@ -106,10 +106,7 @@ class StyleDatabase:
if os.path.exists(path):
shutil.copy(path, f"{path}.bak")
- fd = os.open(path, os.O_RDWR | os.O_CREAT)
- with os.fdopen(fd, "w", encoding="utf-8-sig", newline='') as file:
- # _fields is actually part of the public API: typing.NamedTuple is a replacement for collections.NamedTuple,
- # and collections.NamedTuple has explicit documentation for accessing _fields. Same goes for _asdict()
+ with open(path, "w", encoding="utf-8-sig", newline='') as file:
writer = csv.DictWriter(file, fieldnames=PromptStyle._fields)
writer.writeheader()
writer.writerows(style._asdict() for k, style in self.styles.items())