]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:tests: Initialize global variable
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 25 May 2023 04:28:29 +0000 (16:28 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 29 May 2023 22:32:28 +0000 (22:32 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/source_chars.py

index 3f306f12f9a52410c1e5410c87b937b0946d95f4..a5e9fc2fb143668f01b0dbc469273f336132ac7e 100644 (file)
@@ -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)