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:
BIN
Binary file not shown.
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import abc
|
import abc
|
||||||
from string import Template
|
from string import Template
|
||||||
import os, shutil, subprocess, sys
|
import os, shutil, subprocess
|
||||||
|
|
||||||
import libcalamares
|
import libcalamares
|
||||||
from libcalamares.utils import host_env_process_output, target_env_process_output
|
from libcalamares.utils import host_env_process_output, target_env_process_output
|
||||||
@@ -262,9 +262,6 @@ class PMPacman(PackageManager):
|
|||||||
backend = "pacman"
|
backend = "pacman"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
import re
|
|
||||||
progress_match = re.compile("^\\((\\d+)/(\\d+)\\)")
|
|
||||||
|
|
||||||
def line_cb(line):
|
def line_cb(line):
|
||||||
if line.startswith(":: "):
|
if line.startswith(":: "):
|
||||||
self.in_package_changes = "package" in line or "hooks" in line
|
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:
|
while pacman_count <= self.pacman_num_retries:
|
||||||
pacman_count += 1
|
pacman_count += 1
|
||||||
try:
|
try:
|
||||||
if False: # callback:
|
host_env_process_output(command)
|
||||||
host_env_process_output(command, self.line_cb)
|
|
||||||
else:
|
|
||||||
host_env_process_output(command)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
if pacman_count <= self.pacman_num_retries:
|
if pacman_count <= self.pacman_num_retries:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from string import Template
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import libcalamares
|
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
|
from libcalamares.utils import gettext_path, gettext_languages
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
@@ -166,9 +166,6 @@ class PMPacman(PackageManager):
|
|||||||
backend = "pacman"
|
backend = "pacman"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
import re
|
|
||||||
progress_match = re.compile("^\\((\\d+)/(\\d+)\\)")
|
|
||||||
|
|
||||||
def line_cb(line):
|
def line_cb(line):
|
||||||
if line.startswith(":: "):
|
if line.startswith(":: "):
|
||||||
self.in_package_changes = "package" in line or "hooks" in line
|
self.in_package_changes = "package" in line or "hooks" in line
|
||||||
|
|||||||
Reference in New Issue
Block a user