From e44a97fd2435194829e821035c8783dac06fffa5 Mon Sep 17 00:00:00 2001 From: hanwen Date: Sun, 12 Mar 2006 17:51:31 +0000 Subject: [PATCH] (get_latex_textwidth): explicitly close tmphandle. --- ChangeLog | 4 ++-- scripts/lilypond-book.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a89782355e..01e0010eaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,10 @@ 2006-03-12 Han-Wen Nienhuys + * scripts/lilypond-book.py (get_latex_textwidth): explicitly close tmphandle. + * python/lilylib.py (system): rewrite system() using subprocess. Remove >& redirection trickery. - * scripts/convert-ly.py (get_option_parser): - 2006-03-11 Graham Percival * Documentation/user/ changing-defaults, global, scheme-tutorial, diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 5cfe971b6d..322ce9a39b 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1401,7 +1401,11 @@ def get_latex_textwidth (source): (handle, tmpfile) = tempfile.mkstemp('.tex') logfile = os.path.splitext (tmpfile)[0] + '.log' logfile = os.path.split (logfile)[1] - open (tmpfile,'w').write (latex_document) + + tmp_handle = open (tmpfile,'w') + tmp_handle.write (latex_document) + tmp_handle.close () + ly.system ('latex %s' % tmpfile, be_verbose=global_options.verbose) parameter_string = open (logfile).read() -- 2.39.5