From: jenkins-bot Date: Wed, 30 Mar 2016 07:55:18 +0000 (+0000) Subject: Merge "Fix accidential variable overriding in manualWordsTable" X-Git-Tag: 1.31.0-rc.0~7477 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=2379efaad6bddc93e7f08ca42f017890169b44e4;hp=2e5bd7201395d47f15130fce6db52be80da9334b;p=lhc%2Fweb%2Fwiklou.git Merge "Fix accidential variable overriding in manualWordsTable" --- diff --git a/maintenance/language/zhtable/Makefile.py b/maintenance/language/zhtable/Makefile.py index 15a1cb9d0f..abe08e4bf3 100755 --- a/maintenance/language/zhtable/Makefile.py +++ b/maintenance/language/zhtable/Makefile.py @@ -248,7 +248,8 @@ def translate(text, conv_table): def manualWordsTable(path, conv_table, reconv_table): fp = open(path, 'r', encoding='U8') - reconv_table = {} + reconv_table = reconv_table.copy() + out_table = {} wordlist = [line.split('#')[0].strip() for line in fp] wordlist = list(set(wordlist)) wordlist.sort(key=lambda w: (len(w), w), reverse=True) @@ -257,9 +258,9 @@ def manualWordsTable(path, conv_table, reconv_table): new_word = translate(word, conv_table) rcv_word = translate(word, reconv_table) if word != rcv_word: - reconv_table[word] = word - reconv_table[new_word] = word - return reconv_table + reconv_table[word] = out_table[word] = word + reconv_table[new_word] = out_table[new_word] = word + return out_table def defaultWordsTable(src_wordlist, src_tomany, char_conv_table,