Skip to content

Commit 9986ffd

Browse files
committed
Python 2 and 3 support. Convert Exception to BaseException. TAL and
PageTemplate code.
1 parent 8c25423 commit 9986ffd

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

roundup/cgi/PageTemplates/Expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def installHandlers(engine):
5151
try:
5252
from zExceptions import Unauthorized
5353
except ImportError:
54-
class Unauthorized(Exception):
54+
class Unauthorized(BaseException):
5555
pass
5656

5757
def acquisition_security_filter(orig, inst, name, v, real_validate):

roundup/cgi/PageTemplates/TALES.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
_parse_expr = re.compile(r"(%s):" % NAME_RE).match
3535
_valid_name = re.compile('%s$' % NAME_RE).match
3636

37-
class TALESError(Exception):
37+
class TALESError(BaseException):
3838
"""Error during TALES expression evaluation"""
3939

4040
class Undefined(TALESError):
4141
'''Exception raised on traversal of an undefined path'''
4242

43-
class RegistrationError(Exception):
43+
class RegistrationError(BaseException):
4444
'''TALES Type Registration Error'''
4545

46-
class CompilerError(Exception):
46+
class CompilerError(BaseException):
4747
'''TALES Compiler Error'''
4848

4949
class Default:
@@ -85,7 +85,7 @@ class ErrorInfo:
8585
__allow_access_to_unprotected_subobjects__ = 1
8686

8787
def __init__(self, err, position=(None, None)):
88-
if isinstance(err, Exception):
88+
if isinstance(err, BaseException):
8989
self.type = err.__class__
9090
self.value = err
9191
else:

roundup/cgi/TAL/DummyEngine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _Default:
4444

4545
name_match = re.compile(r"(?s)(%s):(.*)\Z" % NAME_RE).match
4646

47-
class CompilerError(Exception):
47+
class CompilerError(BaseException):
4848
pass
4949

5050
class DummyEngine:

roundup/cgi/TAL/HTMLParser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
endtagfind = re.compile('</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>')
4848

4949

50-
class HTMLParseError(Exception):
50+
class HTMLParseError(BaseException):
5151
"""Exception raised for all parse errors."""
5252

5353
def __init__(self, msg, position=(None, None)):

roundup/cgi/TAL/TALDefs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"name",
6565
]
6666

67-
class TALError(Exception):
67+
class TALError(BaseException):
6868

6969
def __init__(self, msg, position=(None, None)):
7070
assert msg != ""

0 commit comments

Comments
 (0)