summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2010-05-10 13:58:52 -0400
committerAvery Pennarun <apenwarr@gmail.com>2010-05-10 13:58:52 -0400
commit2d77403a0b544bd0b58778d17f09d9619a5b9241 (patch)
tree5f1c11cb97980887898da83eb93910b100fe3ce4
parent77cf37e0fa668f774edb7f4b1891146ce78a0ae2 (diff)
Don't use try/except/finally so that python 2.4 works.
Use try/(try/except)/finally instead. There was only once case of this. Thanks to Wayne Scott and nisc for pointing this out.
-rw-r--r--server.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/server.py b/server.py
index 04674f6..ec2d87f 100644
--- a/server.py
+++ b/server.py
@@ -79,14 +79,15 @@ def start_hostwatch(seed_hosts):
# child
rv = 99
try:
- s2.close()
- os.dup2(s1.fileno(), 1)
- os.dup2(s1.fileno(), 0)
- s1.close()
- rv = hostwatch.hw_main(seed_hosts) or 0
- except Exception, e:
- log('%s\n' % _exc_dump())
- rv = 98
+ try:
+ s2.close()
+ os.dup2(s1.fileno(), 1)
+ os.dup2(s1.fileno(), 0)
+ s1.close()
+ rv = hostwatch.hw_main(seed_hosts) or 0
+ except Exception, e:
+ log('%s\n' % _exc_dump())
+ rv = 98
finally:
os._exit(rv)
s1.close()