summaryrefslogtreecommitdiff
path: root/gerber/render/cairo_backend.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2016-11-07 21:18:31 -0500
committerGitHub <noreply@github.com>2016-11-07 21:18:31 -0500
commit7030eee5e28180732c5cf98aeda4b66657223870 (patch)
tree963ceab268c54bb8379c7ea612d6b0a021a16424 /gerber/render/cairo_backend.py
parent22e668c75f24174d2090443ed98e804b3737bd84 (diff)
parent369ac7b2a33b0de2e95eb2f0ec38d543ad7ca98d (diff)
downloadgerbonara-7030eee5e28180732c5cf98aeda4b66657223870.tar.gz
gerbonara-7030eee5e28180732c5cf98aeda4b66657223870.tar.bz2
gerbonara-7030eee5e28180732c5cf98aeda4b66657223870.zip
Merge pull request #57 from girtsf/master
cairo_backend.py: use BytesIO instead of StringIO
Diffstat (limited to 'gerber/render/cairo_backend.py')
-rw-r--r--gerber/render/cairo_backend.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index df4fcf1..d7026b8 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -25,10 +25,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):
@@ -125,9 +122,9 @@ class GerberCairoContext(GerberContext):
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()