diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-01-14 12:04:42 +0000 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-01-14 12:04:42 +0000 |
commit | e02f37b11c2fbdceaacca74b5f0c8ff1fa24eb15 (patch) | |
tree | a378a239c1731f8036cf7501617933dba8772b72 /amqp_codegen.py | |
parent | 624d2cc63eb04786f5e234fb92c60f5153a1a082 (diff) | |
parent | 05e233ca7d7f75eec9d7c5ab45ab60aff29a53a0 (diff) | |
download | rabbitmq-codegen-e02f37b11c2fbdceaacca74b5f0c8ff1fa24eb15.tar.gz |
merge bug23645 into default (C client is lacking some methods in its API)
Diffstat (limited to 'amqp_codegen.py')
-rw-r--r-- | amqp_codegen.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/amqp_codegen.py b/amqp_codegen.py index cbfdcf8..c6c6a5f 100644 --- a/amqp_codegen.py +++ b/amqp_codegen.py @@ -32,7 +32,7 @@ from __future__ import nested_scopes import re import sys -from os import remove +import os from optparse import OptionParser try: @@ -271,16 +271,16 @@ def do_main_dict(funcDict): def execute(fn, amqp_specs, out_file): stdout = sys.stdout f = open(out_file, 'w') + success = False try: - try: - sys.stdout = f - fn(amqp_specs) - except: - remove(out_file) - raise + sys.stdout = f + fn(amqp_specs) + success = True finally: sys.stdout = stdout f.close() + if not success: + os.remove(out_file) parser = OptionParser() parser.add_option("--ignore-conflicts", action="store_true", dest="ignore_conflicts", default=False) |