Ensure we return the temp path, not the file handle
- ID
b8caea2- date
2021-02-20 23:49:28+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
4b5b3cb- message
Ensure we return the temp path, not the file handle- changed files
1 file, 1 addition, 1 deletion
Changed files
happybackgrounds.py (7077 → 7090)
diff --git a/happybackgrounds.py b/happybackgrounds.py
index 8631e9a..e35fe56 100755
--- a/happybackgrounds.py
+++ b/happybackgrounds.py
@@ -144,7 +144,7 @@ def create_svg(
lines.append("</svg>")
if out_path is None:
- out_path, _ = tempfile.mkstemp()
+ _, out_path = tempfile.mkstemp(suffix=".svg")
with open(out_path, "w") as outfile:
outfile.write("\n".join(lines))