From 8292e4ac1a3b475f3238bcd537fa6182e5b9ac69 Mon Sep 17 00:00:00 2001 From: Ed Halley Date: Sat, 25 Nov 2006 17:34:57 +0000 Subject: [PATCH] Was crashing the import_obj script when using Python 2.3. Python 2.4+ supports large list processing with generators, but Python 2.3 will break if you use that syntax. Until we depend on the newer versions, I have commented out the generator syntax and only use the list-comprehension type instead. --- release/scripts/import_obj.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/release/scripts/import_obj.py b/release/scripts/import_obj.py index 806eb7c3422..49d5c1c588c 100644 --- a/release/scripts/import_obj.py +++ b/release/scripts/import_obj.py @@ -314,11 +314,10 @@ def create_mesh(new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, v elif not face_vert_tex_indicies: # images that are -1 are lines, a bit obscure but works. if CREATE_EDGES: - try: # python 2.4+ - edges.extend( (face_vert_loc_indicies[i], face_vert_loc_indicies[i+1]) for i in xrange(len_face_vert_loc_indicies-1) ) - except: # python 2.3 - edges.extend( [(face_vert_loc_indicies[i], face_vert_loc_indicies[i+1]) for i in xrange(len_face_vert_loc_indicies-1)] ) - + # generators are better in python 2.4+ but can't be used in 2.3 + # edges.extend( (face_vert_loc_indicies[i], face_vert_loc_indicies[i+1]) for i in xrange(len_face_vert_loc_indicies-1) ) + edges.extend( [(face_vert_loc_indicies[i], face_vert_loc_indicies[i+1]) for i in xrange(len_face_vert_loc_indicies-1)] ) + faces.pop(f_idx) else: