From 4a437a3c422ee8a7b3dfee9a90abc2d9cc9e7990 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Tue, 3 Sep 2019 11:48:50 +0200 Subject: [PATCH] config plugin: replace 'is 0' with '== 0' Since python3.8, identity checks with literal produce syntax warnings. Replace the check 'if .. is 0' with 'if .. == 0' Related: https://pagure.io/freeipa/issue/8057 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Christian Heimes --- ipaserver/plugins/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipaserver/plugins/config.py b/ipaserver/plugins/config.py index c755a8850..77a9f2c80 100644 --- a/ipaserver/plugins/config.py +++ b/ipaserver/plugins/config.py @@ -503,12 +503,12 @@ class config_mod(LDAPUpdate): # Set ipasearchrecordslimit to -1 if 0 is used if 'ipasearchrecordslimit' in entry_attrs: - if entry_attrs['ipasearchrecordslimit'] is 0: + if entry_attrs['ipasearchrecordslimit'] == 0: entry_attrs['ipasearchrecordslimit'] = -1 # Set ipasearchtimelimit to -1 if 0 is used if 'ipasearchtimelimit' in entry_attrs: - if entry_attrs['ipasearchtimelimit'] is 0: + if entry_attrs['ipasearchtimelimit'] == 0: entry_attrs['ipasearchtimelimit'] = -1 for (attr, obj) in (('ipauserobjectclasses', 'user'),