← Back to team overview

instant team mailing list archive

Fixed a small bug in instant.py

 

Hello!

While digging in some compile.log files I realised that we did not get the 
whole error message as the file was not flushed, or closed, before the 
program quit.

Whith this patch it is.

Johan
# HG changeset patch
# User "Johan Hake <hake@xxxxxxxxx>"
# Date 1218098431 -7200
# Node ID 86736bf0e8fef78f2deaa98997320901e73f379e
# Parent  0085b83aadb91c7414b471d246250acaea94ec1b
Closed the compile.log file in the finally statement.
If something happens during compilation we now get the whole error message.

diff -r 0085b83aadb9 -r 86736bf0e8fe src/instant.py
--- a/src/instant.py	Mon Aug 04 15:52:57 2008 +0200
+++ b/src/instant.py	Thu Aug 07 10:40:31 2008 +0200
@@ -375,6 +375,10 @@
         finally:
             # always get back to original directory
             os.chdir(previous_path)
+            
+            # Close the log file in case of a raised RuntimeError,
+            # otherwise the stream will not get flushed
+            compile_log_file.close()
         
         # Get md5 sum from .md5 file in temporary module dir
         tmp_module_dir = os.path.join(get_tmp_dir(), self.module)

Follow ups