inkscape/f5e0ea893f34_extensions_python3_compatibility.patch

35 lines
1.2 KiB
Diff

From f5e0ea893f34c91f25d4781b37ee6eff15a7e213 Mon Sep 17 00:00:00 2001
From: Thomas Holder <thomas@thomas-holder.de>
Date: Thu, 7 Mar 2019 21:48:37 +0100
Subject: [PATCH] extensions 2to3: fix dxf_outlines
---
share/extensions/dxf_outlines.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index 63d813f94c..e07681bbba 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -31,6 +31,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
+import sys
import math
# local library
import inkex
@@ -101,7 +102,8 @@ class MyEffect(inkex.Effect):
self.d = array([0], float) # knot vector
self.poly = [[0.0,0.0]] # LWPOLYLINE data
def output(self):
- print(b''.join(self.dxf))
+ stdout = sys.stdout if sys.version_info[0] < 3 else sys.stdout.buffer
+ stdout.write(b''.join(self.dxf))
def dxf_add(self, str):
self.dxf.append(str.encode(self.options.char_encode))
def dxf_line(self,csp):
--
2.21.0