diff options
author | Mathieu Bridon <[email protected]> | 2018-07-05 15:17:35 +0200 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-07-24 11:07:04 -0700 |
commit | 1d209275c29886bac218d77135f61ae52464a1be (patch) | |
tree | 4c6799c2e035b47743303eed6b4e8b75e737b18a /src/util/xmlpool/gen_xmlpool.py | |
parent | 9b3474249513267bb4e50d450c70e688bffbc082 (diff) |
python: Better check for keys in dicts
Python 3 lost the dict.has_key() method. Instead it requires using the
"in" operator.
This is also compatible with Python 2.
Signed-off-by: Mathieu Bridon <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/util/xmlpool/gen_xmlpool.py')
-rw-r--r-- | src/util/xmlpool/gen_xmlpool.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py index 8336e0f9523..886c1854f3a 100644 --- a/src/util/xmlpool/gen_xmlpool.py +++ b/src/util/xmlpool/gen_xmlpool.py @@ -42,7 +42,7 @@ def escapeCString (s): # open quote q = u'\u201d' r = r + q - elif escapeSeqs.has_key(s[i]): + elif s[i] in escapeSeqs: r = r + escapeSeqs[s[i]] else: r = r + s[i] @@ -90,7 +90,7 @@ def expandCString (s): escape = False r = r + chr(num) else: - if escapeSeqs.has_key(s[i]): + if s[i] in escapeSeqs: r = r + escapeSeqs[s[i]] escape = False elif s[i] >= '0' and s[i] <= '7': |