/[opental]/opental/OpenTAL/Expressions.py
ViewVC logotype

Diff of /opental/OpenTAL/Expressions.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by lalo, Thu Jan 16 22:52:46 2003 UTC revision 1.9 by lalo, Mon Jan 27 02:06:27 2003 UTC
# Line 33  _valid_name = re.compile('%s$' % NAME_RE Line 33  _valid_name = re.compile('%s$' % NAME_RE
33    
34  class Undefined(Exception):  class Undefined(Exception):
35      '''Exception raised on traversal of an undefined path'''      '''Exception raised on traversal of an undefined path'''
36        def __init__(self, expression, exc_info):
37            self.expression = expression
38            self.type, self.value, self.traceback = exc_info
39            
40      def __str__(self):      def __str__(self):
41          if self.type is None:          if self.type is None:
42              s = self.expression              s = self.expression
43          else:          else:
44              s = '%s not found in %s' % (self.value,              s = '%s not found in %s' % (self.value,
45                                          `self.expression`)                                          `self.expression`)
46          if self.lineno is not None:  ##         if self.lineno is not None:
47              s = "%s, at line %d" % (s, self.lineno)  ##             s = "%s, at line %d" % (s, self.lineno)
48          if self.offset is not None:  ##         if self.offset is not None:
49              s = "%s, column %d" % (s, self.offset + 1)  ##             s = "%s, column %d" % (s, self.offset + 1)
50          return s          return s
51    
52  class RegistrationError(Exception):  class RegistrationError(Exception):
# Line 178  class PathExpr: Line 182  class PathExpr:
182                  ob = self._subexprs[-1](econtext)                  ob = self._subexprs[-1](econtext)
183              except econtext._engine.Undefs[1:]:              except econtext._engine.Undefs[1:]:
184                  e = Undefined(self._s, sys.exc_info())                  e = Undefined(self._s, sys.exc_info())
185                  print "masking exception as Undefined:"                  print >>sys.stderr, "masking exception as Undefined:"
186                  print_exception(e.type, e.value, e.traceback)                  print_exception(e.type, e.value, e.traceback)
187                  raise e                  raise e
188    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26