summaryrefslogtreecommitdiff
path: root/gerber
diff options
context:
space:
mode:
Diffstat (limited to 'gerber')
-rw-r--r--gerber/render/cairo_backend.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index 2791d76..0ae5d40 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -154,7 +154,9 @@ class GerberCairoContext(GerberContext):
self.surface_buffer.flush()
with open(filename, "w") as f:
- f.write(open(self.surface_buffer.name, "r").read())
+ self.surface_buffer.seek(0)
+ f.write(self.surface_buffer.read())
f.flush()
+
else:
self.surface.write_to_png(filename)