From b0ad0ff4d75ac59268ec8cf07bc0d47202db4ca7 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 (cherry picked from commit 48402cd52693b29a42ec1653e22755d8ec215f38) --- 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 16abd9f59c..e1ea9723dc 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -99,7 +99,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 @@ -201,7 +201,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'])