2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 18:17:09 +00:00

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.
This commit is contained in:
Christian Boltz 2025-06-04 19:26:27 +02:00
parent 23deb55149
commit 2bfdcb780f
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C
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): 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) aaui.UI_Info(_('Reading log entries from %s.') % logfile)
load_sev_db() load_sev_db()
# print(pid)
# print(active_profiles)
log_reader = apparmor.logparser.ReadLog(logfile, active_profiles, profile_dir) log_reader = apparmor.logparser.ReadLog(logfile, active_profiles, profile_dir)
hashlog = log_reader.read_log(logmark) hashlog = log_reader.read_log(logmark)

View File

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

View File

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