diff options
Diffstat (limited to 'gerberex')
-rw-r--r-- | gerberex/dxf.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gerberex/dxf.py b/gerberex/dxf.py index e863238..1b2ddf7 100644 --- a/gerberex/dxf.py +++ b/gerberex/dxf.py @@ -3,7 +3,7 @@ # Copyright 2019 Hiroshi Murayama <opiopan@gmail.com> -import io +import io, sys from math import pi, cos, sin, tan, atan, atan2, acos, asin, sqrt import dxfgrabber from gerber.cam import CamFile, FileSettings @@ -561,6 +561,8 @@ class DxfFile(CamFile): raise Exception('Not supported') def loads(data, filename=None): + if sys.version_info.major == 2: + data = unicode(data) stream = io.StringIO(data) dxf = dxfgrabber.read(stream) return DxfFile(dxf) |