Skip to content

Commit 7935eb0

Browse files
committed
Fix exception handling to be python2.5 compatible
The exception handling introduced in commit hg:494d2550: Display errors containing HTML with RejectRaw (issue2550847) contained the new style of exception handling that is not compatible with python2.5. Rework these exception handlers to use the old style to maintain compatibility with python2.5
1 parent 455f0db commit 7935eb0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

roundup/cgi/actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def handle(self):
620620
# handle the props
621621
try:
622622
message = self._editnodes(props, links)
623-
except (ValueError, KeyError, IndexError, Reject) as message:
623+
except (ValueError, KeyError, IndexError, Reject), message:
624624
escape = not isinstance(message, RejectRaw)
625625
self.client.add_error_message(
626626
self._('Edit Error: %s') % str(message), escape=escape)
@@ -666,7 +666,7 @@ def handle(self):
666666
try:
667667
# when it hits the None element, it'll set self.nodeid
668668
messages = self._editnodes(props, links)
669-
except (ValueError, KeyError, IndexError, Reject) as message:
669+
except (ValueError, KeyError, IndexError, Reject), message:
670670
escape = not isinstance(message, RejectRaw)
671671
# these errors might just be indicative of user dumbness
672672
self.client.add_error_message(_('Error: %s') % str(message),
@@ -850,7 +850,7 @@ def handle(self):
850850
try:
851851
# when it hits the None element, it'll set self.nodeid
852852
messages = self._editnodes(props, links)
853-
except (ValueError, KeyError, IndexError, Reject) as message:
853+
except (ValueError, KeyError, IndexError, Reject), message:
854854
escape = not isinstance(message, RejectRaw)
855855
# these errors might just be indicative of user dumbness
856856
self.client.add_error_message(_('Error: %s') % str(message),

roundup/cgi/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ def handle_action(self):
12741274
return getattr(self, action_klass)()
12751275
else:
12761276
return action_klass(self).execute()
1277-
except (ValueError, Reject) as err:
1277+
except (ValueError, Reject), err:
12781278
escape = not isinstance(err, RejectRaw)
12791279
self.add_error_message(str(err), escape=escape)
12801280

0 commit comments

Comments
 (0)