Run the serialization inside a single try block.
authorLukas Tönne <lukas.toenne@gmail.com>
Wed, 10 Dec 2014 18:20:04 +0000 (19:20 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Wed, 10 Dec 2014 18:20:04 +0000 (19:20 +0100)
object_physics_meadow/blob.py

index 9ac4b50..95d656d 100644 (file)
@@ -185,8 +185,8 @@ def blobs_from_customprops(data):
     iter_samples_nor = iter(data['samples_nor'])
     iter_samples_idx = iter(data['samples_idx'])
 
-    while(True):
-        try:
+    try:
+        while(True):
             loc = (next(iter_loc), next(iter_loc), next(iter_loc))
             nor = (next(iter_nor), next(iter_nor), next(iter_nor))
             face_index = next(iter_face_index)
@@ -202,8 +202,8 @@ def blobs_from_customprops(data):
             blob = Blob(loc, nor, face_index)
             blob.samples = samples
             blobs.append(blob)
-        except StopIteration:
-            break
+    except StopIteration:
+        break
 
     return blobs