summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/ipc356.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-06-13 15:13:29 +0200
committerjaseg <git@jaseg.de>2021-06-13 15:13:29 +0200
commit4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c (patch)
tree9b491f11c2c77c5e8de8b74eed75162838c5dbf5 /gerbonara/gerber/ipc356.py
parent83e498b8917e0b3287871c27a4acc95634acab2e (diff)
downloadgerbonara-4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c.tar.gz
gerbonara-4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c.tar.bz2
gerbonara-4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c.zip
Make pcb-tools pytest pass without warnings
Diffstat (limited to 'gerbonara/gerber/ipc356.py')
-rw-r--r--gerbonara/gerber/ipc356.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gerbonara/gerber/ipc356.py b/gerbonara/gerber/ipc356.py
index 9337a99..55c079a 100644
--- a/gerbonara/gerber/ipc356.py
+++ b/gerbonara/gerber/ipc356.py
@@ -163,7 +163,7 @@ class IPCNetlistParser(object):
return FileSettings(units=self.units, angle_units=self.angle_units)
def parse(self, filename):
- with open(filename, 'rU') as f:
+ with open(filename, 'r') as f:
data = f.read()
return self.parse_raw(data, filename)
@@ -382,8 +382,8 @@ class IPC356_Outline(object):
coord_strings = line.strip().split()[1:]
for coord in coord_strings:
coord_dict = _COORD.match(coord).groupdict()
- x = int(coord_dict['x']) if coord_dict['x'] is not '' else x
- y = int(coord_dict['y']) if coord_dict['y'] is not '' else y
+ x = int(coord_dict['x']) if coord_dict['x'] != '' else x
+ y = int(coord_dict['y']) if coord_dict['y'] != '' else y
points.append((x * scale, y * scale))
return cls(type, points)
@@ -412,9 +412,9 @@ class IPC356_Conductor(object):
x = 0
y = 0
x = int(aperture_dict['x']) * \
- scale if aperture_dict['x'] is not '' else None
+ scale if aperture_dict['x'] != '' else None
y = int(aperture_dict['y']) * \
- scale if aperture_dict['y'] is not '' else None
+ scale if aperture_dict['y'] != '' else None
aperture = (x, y)
# Parse out conductor shapes
@@ -428,8 +428,8 @@ class IPC356_Conductor(object):
coords = rshape.split()
for coord in coords:
coord_dict = _COORD.match(coord).groupdict()
- x = int(coord_dict['x']) if coord_dict['x'] is not '' else x
- y = int(coord_dict['y']) if coord_dict['y'] is not '' else y
+ x = int(coord_dict['x']) if coord_dict['x'] != '' else x
+ y = int(coord_dict['y']) if coord_dict['y'] != '' else y
shape.append((x * scale, y * scale))
shapes.append(tuple(shape))
return cls(net_name, layer, aperture, tuple(shapes))