Changeset 1869
- Timestamp:
- Oct 6, 2005, 10:20:31 AM (19 years ago)
- Location:
- inundation/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/least_squares.py
r1846 r1869 81 81 concatinate_attributelist 82 82 83 83 84 84 try: 85 85 mesh_dict = import_mesh_file(mesh_file) … … 87 87 if display_errors: 88 88 print "Could not load bad file. ", e 89 import sys; sys.exit() 89 raise IOError #Re-raise exception 90 90 91 vertex_coordinates = mesh_dict['vertices'] 91 92 triangles = mesh_dict['triangles'] -
inundation/pyvolution/test_least_squares.py
r1863 r1869 1491 1491 fit_to_mesh_file(mesh_file, point_file, 1492 1492 mesh_output_file, display_errors = False) 1493 except SystemExit: pass 1493 except IOError: 1494 pass 1494 1495 else: 1495 self.failUnless(0 ==1, 'Bad file did not raise error!') 1496 raise 'Bad file did not raise error!' 1497 1496 1498 #clean up 1497 1499 os.remove(mesh_file) … … 1522 1524 fd.close() 1523 1525 1524 mesh_output_file = "e:\new_triangle.tsh" #Deliberately bad file 1526 #FIXME (Ole): Is this a deliberately bad filename to invoke the error? 1527 #There might be platform issus (Unix/Windows) 1528 #In any case, the call itself does not raise an exception on cyclone - why? 1529 mesh_output_file = "e:\new_triangle.tsh" 1525 1530 try: 1526 1531 fit_to_mesh_file(mesh_file, point_file, 1527 1532 mesh_output_file, display_errors = False) 1528 except SystemExit:1533 except IOError: 1529 1534 pass 1530 1535 else: 1531 #self.failUnless(0 ==1, 'Bad file did not raise error!')1532 #FIXME (Ole) Did not work on my computer: This one does:1533 1536 raise 'Bad file did not raise error!' 1534 1537
Note: See TracChangeset
for help on using the changeset viewer.