[Kimchi-devel] [PATCH 3/3] Fix RuntimeWarning in check_i18n.py

Lucio Correia luciojhc at linux.vnet.ibm.com
Fri Oct 2 13:32:39 UTC 2015


check_i18n.py throws an error trying to import local files (file
names preceeded by './').

This patch fixes it by ignoring also the '.' when loading the
module. The '.' is still necessary for check_obsolete_messages().

Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
---
 src/wok/plugins/kimchi/contrib/check_i18n.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/wok/plugins/kimchi/contrib/check_i18n.py b/src/wok/plugins/kimchi/contrib/check_i18n.py
index 6a2603c..ac6efc7 100755
--- a/src/wok/plugins/kimchi/contrib/check_i18n.py
+++ b/src/wok/plugins/kimchi/contrib/check_i18n.py
@@ -37,7 +37,7 @@ BAD_PATTERN = re.compile(r"%\([^)]*?\)")
 
 def load_i18n_module(i18nfile):
     path = os.path.dirname(i18nfile)
-    mname = i18nfile.replace("/", "_").rstrip(".py")
+    mname = i18nfile.replace("./", "_").replace("/", "_").rstrip(".py")
     mobj = imp.find_module("i18n", [path])
     return imp.load_module(mname, *mobj)
 
-- 
1.7.1




More information about the Kimchi-devel mailing list