Hi, > Thanks a lot for quick testing and the patch! > Since f only needs to be closed if it has succesfully opened and thus > did not raise IOError, I pushed a fix which puts f.close() inside the > try statement.
Thanks for applying! One thing though, what if file is open but fails during read operation? like if it was edited by hand and there was a mistake? We catch the exception then, but leave the file open? I'm not sure here though. Btw - sorry for messy patch, not made using format-patch and with debug output I used to track the issue, whoops!... Anyway, I noticed one more issue I had fixed on my copy for some time (it's setup thing again, Python3 is default on my OS), today I found out how to fix it in right way. So, here it goes - brushlib/generate.py is called by build script using "python generate.py", if default Python is Python 3 as in my case, it makes the build fail on new print-as-function syntax. Simply using same python version as for rest of MyPaint fixes the issue. I hope, that this patch will be better quality. I Exported the 'python' from main build file and imported it in brushlib build script, then just replaced string python with value of variable python. This patch, together with previous fix you just applied, makes it build and run on my setup, that is Python 3 as default + Python 2.7 in background. Cheers, Andrzej.
From 6029d889f2ea2dadf8a6dc759cc733b0b8d47b6c Mon Sep 17 00:00:00 2001 From: Andrzej Giniewicz <[email protected]> Date: Tue, 28 Dec 2010 18:49:19 +0100 Subject: [PATCH] Use correct version of python for generate.py The brushlib/generate.py is called by build script using "python generate.py", if default Python is Python 3 as in my case, it makes the build fail on new print-as-function syntax. Simply using same python version as for rest of MyPaint fixes the issue. --- SConstruct | 2 +- brushlib/SConscript | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 1b4f022..35ff8a5 100644 --- a/SConstruct +++ b/SConstruct @@ -65,7 +65,7 @@ if env['debug']: env.Append(CPPDEFINES='HEAVY_DEBUG') env.Append(CCFLAGS='-O0', LINKFLAGS='-O0') -Export('env') +Export('env', 'python') module = SConscript('lib/SConscript') SConscript('brushlib/SConscript') languages = SConscript('po/SConscript') diff --git a/brushlib/SConscript b/brushlib/SConscript index cebdfc6..12d29e3 100644 --- a/brushlib/SConscript +++ b/brushlib/SConscript @@ -1,5 +1,5 @@ -Import('env') -env.Execute('python generate.py') +Import('env', 'python') +env.Execute(python + ' generate.py') env.Clean('.', 'brushsettings.hpp') env.Clean('.', Glob('*.pyc')) -- 1.7.3.4
_______________________________________________ Mypaint-discuss mailing list [email protected] https://mail.gna.org/listinfo/mypaint-discuss
