X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=mimedecode.py;h=692a0f0d700706799203af81c59a00b9e8df5ef6;hb=756d99ddf8e83923115e11b0641148ebdf80ee66;hp=78783ae6e2e7ffe930d5db226d54851e2433f7fe;hpb=75fa3299ddbda6c432999a26d16fccf7bccfb34d;p=mimedecode.git diff --git a/mimedecode.py b/mimedecode.py index 78783ae..692a0f0 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -390,7 +390,8 @@ if __name__ == "__main__": gopts.outfile = outfile output = outfile.write - decode_file(infile) - - infile.close() - outfile.close() + try: + decode_file(infile) + finally: + infile.close() + outfile.close()