Пример #1
0
    def render(self,md):
        expr = self.expr
        if expr is None:
            t = convertExceptionType(self.__name__)
            if t is None:
                t = RuntimeError
        else:
            try:
                t = expr.eval(md)
            except:
                t = convertExceptionType(self.__name__)
                if t is None:
                    t = InvalidErrorTypeExpression

        try:
            v = render_blocks(self.section, md)
        except:
            v = 'Invalid Error Value'
        
        # String Exceptions are deprecated on Python 2.5 and
        # plain won't work at all on Python 2.6. So try to upgrade it
        # to a real exception.
        t, v = upgradeException(t, v)
        raise t, v
Пример #2
0
    def render(self, md):
        expr = self.expr
        if expr is None:
            t = convertExceptionType(self.__name__)
            if t is None:
                t = RuntimeError
        else:
            try:
                t = expr.eval(md)
            except:
                t = convertExceptionType(self.__name__)
                if t is None:
                    t = InvalidErrorTypeExpression

        try:
            v = render_blocks(self.section, md)
        except:
            v = 'Invalid Error Value'

        # String Exceptions are deprecated on Python 2.5 and
        # plain won't work at all on Python 2.6. So try to upgrade it
        # to a real exception.
        t, v = upgradeException(t, v)
        raise t, v
Пример #3
0
 def _callFUT(self, name):
     from zExceptions import convertExceptionType
     return convertExceptionType(name)
Пример #4
0
 def _callFUT(self, name):
     from zExceptions import convertExceptionType
     return convertExceptionType(name)