BUGFIX: 'U' mode depreciated in open in favor of io.open

'U' is universal line support mode, which is the default mode
in io.open
This commit is contained in:
Tim Mahrt
2016-06-28 20:23:29 +02:00
parent 2dcb92217d
commit 88f79d63e8
+3 -1
View File
@@ -4,6 +4,7 @@ Created on Oct 11, 2012
@author: timmahrt
'''
import io
vowelList = ['a', '@', 'e', 'i', 'o', 'u', '^', '&', '>', ]
@@ -30,7 +31,8 @@ class LexicalTool():
Builds the isle textfile into a dictionary for fast searching
'''
lexDict = {}
wordList = [line.rstrip('\n') for line in open(self.islePath, "rU")]
with io.open(self.islePath, "r") as fd:
wordList = [line.rstrip('\n') for line in fd]
for row in wordList:
word, pronunciation = row.split(" ", 1)