diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-07 21:20:26 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-07 21:20:26 -0500 |
commit | 60d08dc8ad72f5bb0a14d4821451d7dce20b9639 (patch) | |
tree | 59cef68f1449a5be8d2a9a8ed352e3d9974a3edb /gerber/render/cairo_backend.py | |
parent | 6db0658e2336d6405fe1a6acd10dfab39ba8e7ff (diff) | |
parent | 7030eee5e28180732c5cf98aeda4b66657223870 (diff) | |
download | gerbonara-60d08dc8ad72f5bb0a14d4821451d7dce20b9639.tar.gz gerbonara-60d08dc8ad72f5bb0a14d4821451d7dce20b9639.tar.bz2 gerbonara-60d08dc8ad72f5bb0a14d4821451d7dce20b9639.zip |
Merge upstream change
Diffstat (limited to 'gerber/render/cairo_backend.py')
-rw-r--r-- | gerber/render/cairo_backend.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py index 6e95446..31a1e77 100644 --- a/gerber/render/cairo_backend.py +++ b/gerber/render/cairo_backend.py @@ -30,10 +30,7 @@ from .render import GerberContext, RenderSettings from .theme import THEMES
from ..primitives import *
-try:
- from cStringIO import StringIO
-except (ImportError):
- from io import StringIO
+from io import BytesIO
class GerberCairoContext(GerberContext):
@@ -133,9 +130,9 @@ class GerberCairoContext(GerberContext): return self.surface.write_to_png(filename)
def dump_str(self):
- """ Return a string containing the rendered image.
+ """ Return a byte-string containing the rendered image.
"""
- fobj = StringIO()
+ fobj = BytesIO()
self.surface.write_to_png(fobj)
return fobj.getvalue()
|