From: Joseph Sutton Date: Thu, 25 May 2023 04:28:29 +0000 (+1200) Subject: python:tests: Initialize global variable X-Git-Tag: talloc-2.4.1~528 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d308136a5e51f3dd2cef7253b184b8b348ff924f;p=thirdparty%2Fsamba.git python:tests: Initialize global variable Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/source_chars.py b/python/samba/tests/source_chars.py index 3f306f12f9a..a5e9fc2fb14 100644 --- a/python/samba/tests/source_chars.py +++ b/python/samba/tests/source_chars.py @@ -276,6 +276,10 @@ class CharacterTests(TestCase): def check_file_text(): """If called directly as a script, count the found characters.""" + global ROOT + if not ROOT: + ROOT = _find_root() + counts = Counter() for name in iter_source_files(): fullname = os.path.join(ROOT, name)