diff options
author | Serge Guelton <sguelton@quarkslab.com> | 2018-12-18 08:22:47 +0000 |
---|---|---|
committer | Serge Guelton <sguelton@quarkslab.com> | 2018-12-18 08:22:47 +0000 |
commit | 366c089bb3a0eb1d9cebceedf98f6f0518010447 (patch) | |
tree | 6ef1bbfc613309e4b8226f6e7cf55bf656b9eef6 /clang/docs | |
parent | bbb461f7582e2b34c3a44a9348172876075a029d (diff) |
Portable Python script across Python version
dict no longer have the `has_key` method in Python3. Instead, one can
use the `in` keyword which already works in Python2.
llvm-svn: 349447
Diffstat (limited to 'clang/docs')
-rwxr-xr-x | clang/docs/tools/dump_format_style.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py index 2e1e8c12297b..f2682edc7773 100755 --- a/clang/docs/tools/dump_format_style.py +++ b/clang/docs/tools/dump_format_style.py @@ -180,9 +180,9 @@ def read_options(header): 'std::vector<std::string>', 'std::vector<IncludeCategory>', 'std::vector<RawStringFormat>']: - if enums.has_key(option.type): + if option.type in enums: option.enum = enums[option.type] - elif nested_structs.has_key(option.type): + elif option.type in nested_structs: option.nested_struct = nested_structs[option.type] else: raise Exception('Unknown type: %s' % option.type) |