Anonymous avatar Anonymous committed 8da14e9

- minor fix: catching NotFoundError exceptions for all other gettext tools

Comments (0)

Files changed (3)

src/engine/SCons/Tool/msgfmt.py

   """ 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',
 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:

src/engine/SCons/Tool/msginit.py

   """ 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
 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:

src/engine/SCons/Tool/msgmerge.py

 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'],
 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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.