From 4d3713a0453babd2dd83e802dc39f5e0b1de1525 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 10 Feb 2009 10:48:43 +0100 Subject: [PATCH] [FIX] gettextAlias: handle the case when context is None lp bug: https://launchpad.net/bugs/327510 fixed bzr revid: christophe@tinyerp.com-20090210094843-khwkfjd83fha8rvl --- bin/tools/translate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 7e1a7ca08a8..e8ff793fa4a 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -59,7 +59,7 @@ class GettextAlias(object): def __call__(self, source): frame = inspect.stack()[1][0] cr = frame.f_locals.get('cr') - lang = frame.f_locals.get('context', {}).get('lang', False) + lang = (frame.f_locals.get('context') or {}).get('lang', False) if not (lang and cr): return source