summaryrefslogtreecommitdiff
path: root/gerber/excellon.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2015-11-15 22:28:56 -0200
committerPaulo Henrique Silva <ph.silva@gmail.com>2015-11-15 22:28:56 -0200
commit6e29b9bcae8167dbb9c75e5a79e09886b952e988 (patch)
treefbc04c024bacb192567e9fb5d112673bbf6c1600 /gerber/excellon.py
parentebc85181975add0fd98c18441f029e9af696f237 (diff)
downloadgerbonara-6e29b9bcae8167dbb9c75e5a79e09886b952e988.tar.gz
gerbonara-6e29b9bcae8167dbb9c75e5a79e09886b952e988.tar.bz2
gerbonara-6e29b9bcae8167dbb9c75e5a79e09886b952e988.zip
Use Python's universal newlines to open files
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-xgerber/excellon.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py
index 101c6ea..708f50b 100755
--- a/gerber/excellon.py
+++ b/gerber/excellon.py
@@ -51,7 +51,7 @@ def read(filename):
"""
# File object should use settings from source file by default.
- with open(filename, 'r') as f:
+ with open(filename, 'rU') as f:
data = f.read()
settings = FileSettings(**detect_excellon_format(data))
return ExcellonParser(settings).parse(filename)
@@ -326,7 +326,7 @@ class ExcellonParser(object):
return len(self.hits)
def parse(self, filename):
- with open(filename, 'r') as f:
+ with open(filename, 'rU') as f:
data = f.read()
return self.parse_raw(data, filename)
@@ -557,7 +557,7 @@ def detect_excellon_format(data=None, filename=None):
if data is None and filename is None:
raise ValueError('Either data or filename arguments must be provided')
if data is None:
- with open(filename, 'r') as f:
+ with open(filename, 'rU') as f:
data = f.read()
# Check for obvious clues: