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
+1 -1
View File
@@ -94,7 +94,7 @@ def latinToAscii(unicrap):
r = '' r = ''
for i in unicrap: for i in unicrap:
if xlate.has_key(ord(i)): if ord(i) in xlate:
r += xlate[ord(i)] r += xlate[ord(i)]
elif ord(i) >= 0x80: elif ord(i) >= 0x80:
pass pass
+2 -2
View File
@@ -81,7 +81,7 @@ def convert_html_entities(s):
hits.remove(amp) hits.remove(amp)
for hit in hits: for hit in hits:
name = hit[1:-1] name = hit[1:-1]
if htmlentitydefs.name2codepoint.has_key(name): if name in htmlentitydefs.name2codepoint:
s = s.replace(hit, unichr(htmlentitydefs.name2codepoint[name])) s = s.replace(hit, unichr(htmlentitydefs.name2codepoint[name]))
s = s.replace(amp, "&") s = s.replace(amp, "&")
return s return s