chore: fix CodeQL findings

- Remove unused sys import (basestrap/main.py)
- Remove unused target_env_call import (packages/main.py)
- Remove unused progress_match variable in both files
- Remove dead if False: callback branch (basestrap/main.py)
This commit is contained in:
2026-07-06 20:07:32 +02:00
parent 87518fba99
commit 6d28e35d06
3 changed files with 3 additions and 13 deletions
@@ -19,7 +19,7 @@
import abc
from string import Template
import os, shutil, subprocess, sys
import os, shutil, subprocess
import libcalamares
from libcalamares.utils import host_env_process_output, target_env_process_output
@@ -262,9 +262,6 @@ class PMPacman(PackageManager):
backend = "pacman"
def __init__(self):
import re
progress_match = re.compile("^\\((\\d+)/(\\d+)\\)")
def line_cb(line):
if line.startswith(":: "):
self.in_package_changes = "package" in line or "hooks" in line
@@ -313,11 +310,7 @@ class PMPacman(PackageManager):
while pacman_count <= self.pacman_num_retries:
pacman_count += 1
try:
if False: # callback:
host_env_process_output(command, self.line_cb)
else:
host_env_process_output(command)
return
except subprocess.CalledProcessError:
if pacman_count <= self.pacman_num_retries:
@@ -21,7 +21,7 @@ from string import Template
import subprocess
import libcalamares
from libcalamares.utils import check_target_env_call, target_env_call
from libcalamares.utils import check_target_env_call
from libcalamares.utils import gettext_path, gettext_languages
import gettext
@@ -166,9 +166,6 @@ class PMPacman(PackageManager):
backend = "pacman"
def __init__(self):
import re
progress_match = re.compile("^\\((\\d+)/(\\d+)\\)")
def line_cb(line):
if line.startswith(":: "):
self.in_package_changes = "package" in line or "hooks" in line