diff options
author | David Wragg <dpw@lshift.net> | 2009-05-08 16:17:07 +0100 |
---|---|---|
committer | David Wragg <dpw@lshift.net> | 2009-05-08 16:17:07 +0100 |
commit | c4530ecb501eb8dc610ce43631ed162482d18b77 (patch) | |
tree | 27ae4a132999c0920d1f2faca9792ef6010d35b2 | |
parent | 847ea927569a3369088bc8539955aabdd67df151 (diff) | |
download | rabbitmq-codegen-bug20678.tar.gz |
Avoid try: ... except: ... finally: to syppoet python 2.4bug20678
Python 2.4 (as still used by RHEL 5) doesn't have this syntax. You
have to nest a try: ... except: inside a try: ... finally: ...
Tested on Centos 5.
-rw-r--r-- | amqp_codegen.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/amqp_codegen.py b/amqp_codegen.py index ff00c8b..06c772a 100644 --- a/amqp_codegen.py +++ b/amqp_codegen.py @@ -179,11 +179,12 @@ def do_main(header_fn,body_fn): stdout = sys.stdout f = open(out_file, 'w') try: - sys.stdout = f - fn(amqp_spec) - except: - remove(out_file) - raise + try: + sys.stdout = f + fn(amqp_spec) + except: + remove(out_file) + raise finally: sys.stdout = stdout f.close() |