summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-12-14 15:05:16 (GMT)
committerGuido van Rossum <guido@python.org>1992-12-14 15:05:16 (GMT)
commite266344faf20edeb1863be1550b68028a2ae7735 (patch)
tree6b720b36ee8bfbd8bd3744fea56accb9fe2ba669 /Demo
parent4128dedb8b867047d6fbf84e3858105a14b65d7d (diff)
downloadcpython-e266344faf20edeb1863be1550b68028a2ae7735.zip
cpython-e266344faf20edeb1863be1550b68028a2ae7735.tar.gz
cpython-e266344faf20edeb1863be1550b68028a2ae7735.tar.bz2
New 'finally' syntax
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/sgi/al/intercom.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/Demo/sgi/al/intercom.py b/Demo/sgi/al/intercom.py
index d6a13e7..fd983d3 100755
--- a/Demo/sgi/al/intercom.py
+++ b/Demo/sgi/al/intercom.py
@@ -181,21 +181,22 @@ def ioloop1(s, otheraddr):
# Child -- microphone handler
log('child started')
try:
- mike = al.openport('mike', 'r', config)
- # Sleep a while to let the other side get started
- time.sleep(1)
- # Drain the queue before starting to read
- data = mike.readsamps(mike.getfilled())
- # Loop, sending packets from the mike to the net
- while 1:
- data = mike.readsamps(SAMPSPERBUF)
- s.sendto(data, otheraddr)
- except KeyboardInterrupt:
- log('child got interrupt; exiting')
- posix._exit(0)
- except error:
- log('child got error; exiting')
- posix._exit(1)
+ try:
+ mike = al.openport('mike', 'r', config)
+ # Sleep a while to let the other side get started
+ time.sleep(1)
+ # Drain the queue before starting to read
+ data = mike.readsamps(mike.getfilled())
+ # Loop, sending packets from the mike to the net
+ while 1:
+ data = mike.readsamps(SAMPSPERBUF)
+ s.sendto(data, otheraddr)
+ except KeyboardInterrupt:
+ log('child got interrupt; exiting')
+ posix._exit(0)
+ except error:
+ log('child got error; exiting')
+ posix._exit(1)
finally:
log('child got unexpected error; leaving w/ traceback')