From 10d9028e1fdf7431baee73c7f1474d2134bac5fa Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sat, 10 Oct 2015 17:02:45 -0400 Subject: Python 3 fix --- gerber/excellon.py | 6 +++++- gerber/rs274x.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gerber') diff --git a/gerber/excellon.py b/gerber/excellon.py index ba8573d..7333a98 100755 --- a/gerber/excellon.py +++ b/gerber/excellon.py @@ -25,7 +25,11 @@ This module provides Excellon file classes and parsing utilities import math import operator -from cStringIO import StringIO + +try: + from cStringIO import StringIO +except(ImportError): + from io import StringIO from .excellon_statements import * from .cam import CamFile, FileSettings diff --git a/gerber/rs274x.py b/gerber/rs274x.py index 000f7a1..210b590 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -21,8 +21,12 @@ import copy import json import re -from cStringIO import StringIO +try: + from cStringIO import StringIO +except(ImportError): + from io import StringIO + from .gerber_statements import * from .primitives import * from .cam import CamFile, FileSettings -- cgit