From abb7706b6d2cc093a898d8be17e0a194d1879c35 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 14 May 2017 21:47:49 +0200 Subject: [PATCH] Python2 compat for Inkscape --- boxes/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boxes/__init__.py b/boxes/__init__.py index 173eff3..0641140 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -523,7 +523,11 @@ class Boxes: self.formats.convert(self.output, self.format) if self.inkscapefile: - svgutil.svgMerge(self.output, self.inkscapefile, sys.stdout.buffer) + try: + out = sys.stdout.buffer + except AttributeError: + out= sys.stdout + svgutil.svgMerge(self.output, self.inkscapefile, out) ############################################################ ### Turtle graphics commands