From 48402cd52693b29a42ec1653e22755d8ec215f38 Mon Sep 17 00:00:00 2001 From: mirh Date: Tue, 29 Nov 2016 21:03:14 +0100 Subject: [PATCH] build: fix compilation with Python3 has_key() has long been dropped https://docs.python.org/3.1/whatsnew/3.0.html#builtins Should still work with anything from 2.3 onwards https://github.com/NetworkManager/NetworkManager/pull/11 --- libnm/generate-setting-docs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py index 8265bccd10..d2358d9e33 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -82,7 +82,7 @@ def init_constants(girxml, settings): for setting in settings: setting_type_name = 'NM' + setting.attrib['name']; setting_name_symbol = 'NM_' + setting.attrib[symbol_prefix_key].upper() + '_SETTING_NAME' - if constants.has_key(setting_name_symbol): + if setting_name_symbol in constants: setting_name = constants[setting_name_symbol] setting_names[setting_type_name] = setting_name @@ -184,7 +184,7 @@ outfile.write(""" """) for settingxml in settings: - if settingxml.attrib.has_key('abstract'): + if 'abstract' in settingxml.attrib: continue new_func = NM.__getattr__(settingxml.attrib['name'])