Subject: [Instant-dev] Fixed a small bug in instant.py

From: Johan Hake <[email-masked]>
Date: Thu, 7 Aug 2008 10:46:28 +0200

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 <[email-masked]>"
# 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)

---

From: Ilmar Wilbers <[email-masked]>
Date: Thu, 07 Aug 2008 10:49:05 +0200

Nice, I applied it!

ilmar

Johan Hake wrote:
> ------------------------------------------------------------------------
>
> _______________________________________________
> Instant-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/instant-dev

---

From: Johan Hake <[email-masked]>
Date: Thu, 7 Aug 2008 10:51:49 +0200

> Nice, I applied it!

Thanks!

You are fast! :)

Johan

>
> ilmar
>
> Johan Hake wrote:
> > 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
> >