mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-22 08:53:59 +01:00
Fix W601 .has_key() is deprecated
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user