Add a has_key() method to the config classes for third party plugins that have not been ported to python 3

This commit is contained in:
Kovid Goyal 2020-11-01 07:03:03 +05:30
parent 792c2ca847
commit 4ca2847b66
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -362,6 +362,9 @@ class XMLConfig(dict):
self.clear() self.clear()
self.update(d) self.update(d)
def has_key(self, key):
return dict.__contains__(self, key)
def __getitem__(self, key): def __getitem__(self, key):
try: try:
return dict.__getitem__(self, key) return dict.__getitem__(self, key)