2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 01:57:43 +00:00

Merge Remove global declarations when variables are only read

... but don't get a new value assigned.

Found by pyflakes 3.3.2 / python 3.13.3

While on it, remove some obsolete, commented out debugging code.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1708
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
John Johansen 2025-06-05 23:17:20 +00:00
commit 520227e4ea
3 changed files with 0 additions and 9 deletions

View File

@ -1477,15 +1477,9 @@ def set_logfile(filename):
def do_logprof_pass(logmark='', out_dir=None):
# set up variables for this pass
global active_profiles
# changed = dict()
aaui.UI_Info(_('Reading log entries from %s.') % logfile)
load_sev_db()
# print(pid)
# print(active_profiles)
log_reader = apparmor.logparser.ReadLog(logfile, active_profiles, profile_dir)
hashlog = log_reader.read_log(logmark)

View File

@ -72,7 +72,6 @@ def msg(out, output=sys.stdout):
def debug(out):
"""Print debug message"""
global DEBUGGING
if DEBUGGING:
try:
print("DEBUG: %s" % (out), file=sys.stderr)

View File

@ -112,8 +112,6 @@ class T(unittest.TestCase):
def setUp(self):
"""Setup for tests"""
global topdir
self.tmpdir = os.path.realpath(tempfile.mkdtemp(prefix='test-aa-easyprof'))
# Copy everything into place