summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2006-03-14 17:46:42 +0000
committerFred Drake <fdrake@acm.org>2006-03-14 17:46:42 +0000
commit5726caca207c338db30e117d14c74873c850eb1f (patch)
tree8250f1c28c364caf744c1933489435612e905549
parent0303ea98d305ddb78f00c4787c39e538cf55a811 (diff)
downloadzope-tal-5726caca207c338db30e117d14c74873c850eb1f.tar.gz
enable previously-failing test, adding in a fix for the problem:
an on-error expression in a macro can now handle exceptions from slot fillers as intended
-rw-r--r--talinterpreter.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/talinterpreter.py b/talinterpreter.py
index de25ae7..9690c49 100644
--- a/talinterpreter.py
+++ b/talinterpreter.py
@@ -962,14 +962,16 @@ class TALInterpreter(object):
chopped = macs[i:]
del macs[i:]
prev_source = self.sourceFile
- self.interpret(slot)
- if self.sourceFile != prev_source:
- self.engine.setSourceFile(prev_source)
- self.sourceFile = prev_source
- # Restore the stack entries.
- for mac in chopped:
- mac.entering = False # Not entering
- macs.extend(chopped)
+ try:
+ self.interpret(slot)
+ finally:
+ if self.sourceFile != prev_source:
+ self.engine.setSourceFile(prev_source)
+ self.sourceFile = prev_source
+ # Restore the stack entries.
+ for mac in chopped:
+ mac.entering = False # Not entering
+ macs.extend(chopped)
return
# Falling out of the 'if' allows the macro to be interpreted.
self.interpret(block)