comparison markup/tests/eval.py @ 134:df44110ca91d

* Improve the accuracy of line numbers for text nodes, so that reported errors about syntax or evaluation errors in expressions point to the right line (not quite perfect yet, though). * Evaluation errors in expressions now include the original expression code in the traceback.
author cmlenz
date Sun, 06 Aug 2006 18:07:21 +0000
parents 203f459e7e26
children 7888f4104cc0
comparison
equal deleted inserted replaced
133:b9a0031d4bbb 134:df44110ca91d
233 except TypeError, e: 233 except TypeError, e:
234 exc_type, exc_value, exc_traceback = sys.exc_info() 234 exc_type, exc_value, exc_traceback = sys.exc_info()
235 frame = exc_traceback.tb_next 235 frame = exc_traceback.tb_next
236 while frame.tb_next: 236 while frame.tb_next:
237 frame = frame.tb_next 237 frame = frame.tb_next
238 self.assertEqual('<Expression "nothing()">',
239 frame.tb_frame.f_code.co_name)
238 self.assertEqual('index.html', frame.tb_frame.f_code.co_filename) 240 self.assertEqual('index.html', frame.tb_frame.f_code.co_filename)
239 self.assertEqual(50, frame.tb_lineno) 241 self.assertEqual(50, frame.tb_lineno)
240 242
241 243
242 def suite(): 244 def suite():
Copyright (C) 2012-2017 Edgewall Software