From fc12ec23171833d6b8a12f54c5e6148819c3e3b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 7 Jan 2009 11:27:17 +0000 Subject: [PATCH] don't raise exceptions on some errors unless debugging --- release/scripts/import_web3d.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/release/scripts/import_web3d.py b/release/scripts/import_web3d.py index efe30d9a9b8..28bc1a40ef0 100755 --- a/release/scripts/import_web3d.py +++ b/release/scripts/import_web3d.py @@ -1076,6 +1076,9 @@ class vrmlNode(object): # print self.id ok = True while ok: + if i>=len(lines): + return len(lines)-1 + l = lines[i] # print '\tDEBUG:', i, self.node_type, l if l=='': @@ -1085,13 +1088,15 @@ class vrmlNode(object): if l=='}': if self.node_type != NODE_NORMAL: # also ends proto nodes, we may want a type for these too. print 'wrong node ending, expected an } ' + str(i) + ' ' + str(self.node_type) - raise ValueError + if DEBUG: + raise ValueError ### print "returning", i return i+1 if l==']': if self.node_type != NODE_ARRAY: print 'wrong node ending, expected a ] ' + str(i) + ' ' + str(self.node_type) - raise ValueError + if DEBUG: + raise ValueError ### print "returning", i return i+1 @@ -2567,12 +2572,12 @@ def test(): files.sort() tot = len(files) for i, f in enumerate(files): - #if i < 126 or i > 1000000: - # continue - - if i != 1068: + if i < 124 or i > 1000000: continue + #if i != 1068: + # continue + #if i != 12686: # continue @@ -2583,4 +2588,4 @@ def test(): # Window. load_web3d(f, PREF_FLAT=True) - +# test()