From: Joseph Sutton Date: Fri, 29 Sep 2023 00:27:39 +0000 (+1300) Subject: tests/krb5: Initialize variable X-Git-Tag: tevent-0.16.0~268 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eba1ab0c84099361cb4c0a7d3879535a689c45bb;p=thirdparty%2Fsamba.git tests/krb5: Initialize variable This avoids the following exception: Exception: Traceback (most recent call last): File "/samba/bin/python/samba/tests/krb5/kdc_tgs_tests.py", line 2500, in test_renew_pac_request_false tgt = self._modify_tgt(tgt, renewable=True) File "samba/bin/python/samba/tests/krb5/kdc_tgs_tests.py", line 3014, in _modify_tgt return self.modified_ticket( File "/samba/bin/python/samba/tests/krb5/raw_testcase.py", line 5694, in modified_ticket auth_data, new_pac, UnboundLocalError: local variable 'new_pac' referenced before assignment Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py index ed4765d95da..8e49dbb5043 100644 --- a/python/samba/tests/krb5/raw_testcase.py +++ b/python/samba/tests/krb5/raw_testcase.py @@ -5640,9 +5640,9 @@ class RawKerberosTest(TestCase): if expect_pac: self.assertIsNotNone(auth_data) if auth_data is not None: + new_pac = None if exclude_pac: need_to_call_replace_pac = True - new_pac = None elif not modify_pac_fn and not update_pac_checksums: need_to_call_replace_pac = False else: