Skip to content

Commit ea28844

Browse files
author
Kurt Yoder
authored
Merge pull request #72 from einarf/py37-support
Python 3.7 support
2 parents c75887e + 629981b commit ea28844

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

pywavefront/obj.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ def consume_vertices(self):
136136
float(self.values[3]),
137137
)
138138

139-
self.next_line()
139+
try:
140+
self.next_line()
141+
except StopIteration:
142+
break
143+
140144
if not self.values:
141145
break
142146

@@ -162,7 +166,11 @@ def consume_normals(self):
162166
float(self.values[3]),
163167
)
164168

165-
self.next_line()
169+
try:
170+
self.next_line()
171+
except StopIteration:
172+
break
173+
166174
if not self.values:
167175
break
168176

@@ -187,7 +195,11 @@ def consume_texture_coordinates(self):
187195
float(self.values[2]),
188196
)
189197

190-
self.next_line()
198+
try:
199+
self.next_line()
200+
except StopIteration:
201+
break
202+
191203
if not self.values:
192204
break
193205

@@ -376,7 +388,11 @@ def consume_faces(self):
376388
vlast = uv + color + normal + pos
377389

378390
# Break out of the loop when there are no more f statements
379-
self.next_line()
391+
try:
392+
self.next_line()
393+
except StopIteration:
394+
break
395+
380396
if not self.values:
381397
break
382398

0 commit comments

Comments
 (0)