changeset f14ad3f44bda in bugs.tryton.org:default
details: https://hg.tryton.org/bugs.tryton.org?cmd=changeset;node=f14ad3f44bda
description:
Replace has_key by __contains__
diffstat:
detectors/no_texthtml.py | 2 +-
detectors/patches.py | 2 +-
detectors/reviews.py | 2 +-
detectors/textplain.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diffs (46 lines):
diff -r 3c25daec79f7 -r f14ad3f44bda detectors/no_texthtml.py
--- a/detectors/no_texthtml.py Mon Oct 19 10:43:08 2020 +0200
+++ b/detectors/no_texthtml.py Mon Oct 19 11:50:57 2020 +0200
@@ -1,5 +1,5 @@
def audit_html_files(db, cl, nodeid, newvalues):
- if (newvalues.has_key('type')
+ if ('type' in newvalues
and newvalues['type'] in ['text/html', 'html']):
newvalues['type'] = 'text/plain'
diff -r 3c25daec79f7 -r f14ad3f44bda detectors/patches.py
--- a/detectors/patches.py Mon Oct 19 10:43:08 2020 +0200
+++ b/detectors/patches.py Mon Oct 19 11:50:57 2020 +0200
@@ -35,7 +35,7 @@
if patchid in oldkeywords:
# This is already marked as a patch
return
- if not newvalues.has_key('keyword'):
+ if 'keyword' not in newvalues:
newvalues['keyword'] = oldkeywords
newvalues['keyword'].append(patchid)
diff -r 3c25daec79f7 -r f14ad3f44bda detectors/reviews.py
--- a/detectors/reviews.py Mon Oct 19 10:43:08 2020 +0200
+++ b/detectors/reviews.py Mon Oct 19 11:50:57 2020 +0200
@@ -10,7 +10,7 @@
if reviewid in oldkeywords:
# This is already marked as a review
return
- if not newvalues.has_key('keyword'):
+ if 'keyword' not in newvalues:
newvalues['keyword'] = oldkeywords
newvalues['keyword'].append(reviewid)
diff -r 3c25daec79f7 -r f14ad3f44bda detectors/textplain.py
--- a/detectors/textplain.py Mon Oct 19 10:43:08 2020 +0200
+++ b/detectors/textplain.py Mon Oct 19 11:50:57 2020 +0200
@@ -2,7 +2,7 @@
# yet the file content looks like text, change the type to
# text/plain.
def audit_application_octetstream(db, cl, nodeid, newvalues):
- if newvalues.has_key('type') and newvalues['type'] ==
'application/octet-stream':
+ if 'type' in newvalues and newvalues['type'] == 'application/octet-stream':
# check whether this might be a text file
try:
text = newvalues['content'].decode('utf-8')