From f9c10087c8be7de44caa38aab2f59a3c6f489367 Mon Sep 17 00:00:00 2001 From: dirkbaechle Date: Sun, 7 Oct 2012 13:28:24 +0200 Subject: - minor fix: catching NotFoundError exceptions for all other gettext tools --- src/engine/SCons/Tool/msgfmt.py | 10 ++++++++-- src/engine/SCons/Tool/msginit.py | 10 ++++++++-- src/engine/SCons/Tool/msgmerge.py | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/engine/SCons/Tool/msgfmt.py b/src/engine/SCons/Tool/msgfmt.py index 83b54f7..352ba77 100644 --- a/src/engine/SCons/Tool/msgfmt.py +++ b/src/engine/SCons/Tool/msgfmt.py @@ -77,7 +77,10 @@ def generate(env,**kw): """ Generate `msgfmt` tool """ import SCons.Util from SCons.Tool.GettextCommon import _detect_msgfmt - env['MSGFMT'] = _detect_msgfmt(env) + try: + env['MSGFMT'] = _detect_msgfmt(env) + except: + env['MSGFMT'] = 'msgfmt' env.SetDefault( MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ], MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE', @@ -92,7 +95,10 @@ def generate(env,**kw): def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msgfmt_exists - return _msgfmt_exists(env) + try: + return _msgfmt_exists(env) + except: + return False ############################################################################# # Local Variables: diff --git a/src/engine/SCons/Tool/msginit.py b/src/engine/SCons/Tool/msginit.py index 87b3eec..5e9c0e4 100644 --- a/src/engine/SCons/Tool/msginit.py +++ b/src/engine/SCons/Tool/msginit.py @@ -79,7 +79,10 @@ def generate(env,**kw): """ Generate the `msginit` tool """ import SCons.Util from SCons.Tool.GettextCommon import _detect_msginit - env['MSGINIT'] = _detect_msginit(env) + try: + env['MSGINIT'] = _detect_msginit(env) + except: + env['MSGINIT'] = 'msginit' msginitcom = '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}' \ + ' $MSGINITFLAGS -i $SOURCE -o $TARGET' # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded @@ -104,7 +107,10 @@ def generate(env,**kw): def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msginit_exists - return _msginit_exists(env) + try: + return _msginit_exists(env) + except: + return False ############################################################################# # Local Variables: diff --git a/src/engine/SCons/Tool/msgmerge.py b/src/engine/SCons/Tool/msgmerge.py index 78eb2c5..f3710ab 100644 --- a/src/engine/SCons/Tool/msgmerge.py +++ b/src/engine/SCons/Tool/msgmerge.py @@ -70,7 +70,10 @@ def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw): def generate(env,**kw): """ Generate the `xgettext` tool """ from SCons.Tool.GettextCommon import _detect_msgmerge - env['MSGMERGE'] = _detect_msgmerge(env) + try: + env['MSGMERGE'] = _detect_msgmerge(env) + except: + env['MSGMERGE'] = 'msgmerge' env.SetDefault( POTSUFFIX = ['.pot'], POSUFFIX = ['.po'], @@ -88,7 +91,10 @@ def generate(env,**kw): def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msgmerge_exists - return _msgmerge_exists(env) + try: + return _msgmerge_exists(env) + except: + return False ############################################################################# # Local Variables: -- cgit v0.12