Better to return default op context when we can't find a given operator (e.g. console toggling under linux does not exists).

This commit is contained in:
Bastien Montagne 2013-02-09 18:47:40 +00:00
parent e14b21dd6d
commit a4a1c66725

@ -396,7 +396,10 @@ def dump_py_messages_from_files(messages, check_ctxt, files):
try: try:
return op.get_rna().bl_rna.translation_context return op.get_rna().bl_rna.translation_context
except Exception as e: except Exception as e:
default_op_context = bpy.app.translations.contexts.operator_default
print("ERROR: ", str(e)) print("ERROR: ", str(e))
print(" Assuming default operator context '{}'".format(default_op_context))
return default_op_context
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Gather function names # Gather function names