Fix W601 .has_key() is deprecated

This commit is contained in:
Jesse Mullan
2014-11-01 16:20:43 -07:00
parent 4895d562b3
commit 5ede29b401
2 changed files with 3 additions and 3 deletions

View File

@@ -94,7 +94,7 @@ def latinToAscii(unicrap):
r = ''
for i in unicrap:
if xlate.has_key(ord(i)):
if ord(i) in xlate:
r += xlate[ord(i)]
elif ord(i) >= 0x80:
pass

View File

@@ -81,7 +81,7 @@ def convert_html_entities(s):
hits.remove(amp)
for hit in hits:
name = hit[1:-1]
if htmlentitydefs.name2codepoint.has_key(name):
s = s.replace(hit, unichr(htmlentitydefs.name2codepoint[name]))
if name in htmlentitydefs.name2codepoint:
s = s.replace(hit, unichr(htmlentitydefs.name2codepoint[name]))
s = s.replace(amp, "&")
return s