From: Jo Sutton Date: Wed, 24 Apr 2024 01:37:40 +0000 (+1200) Subject: python:tests: Rewrite condition of while loop X-Git-Tag: tdb-1.4.11~919 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f12cf958f8ed92c3373372760564d95adcdfb94;p=thirdparty%2Fsamba.git python:tests: Rewrite condition of while loop Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/dckeytab.py b/python/samba/tests/dckeytab.py index a4ae38a8c0b..ca0dbcf7f2a 100644 --- a/python/samba/tests/dckeytab.py +++ b/python/samba/tests/dckeytab.py @@ -67,7 +67,7 @@ class DCKeytabTests(TestCaseInTempDir): keytab_as_set.add(entry_as_tuple) keytab_bytes = keytab.further_entry - while True: + while keytab_bytes: multiple_entry = ndr_unpack(krb5ccache.MULTIPLE_KEYTAB_ENTRIES, keytab_bytes) entry = multiple_entry.entry entry_as_tuple = entry_to_tuple(entry) @@ -75,8 +75,6 @@ class DCKeytabTests(TestCaseInTempDir): keytab_as_set.add(entry_as_tuple) keytab_bytes = multiple_entry.further_entry - if not keytab_bytes: - break return keytab_as_set