summaryrefslogtreecommitdiff
path: root/src/ukify
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-04-20 20:23:18 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-05-05 18:42:37 +0200
commit7081db294c817db37e6db472bd5e15c670bdcdd3 (patch)
tree5ef3f47fbbbb95147efab959de13d3254bc8eda5 /src/ukify
parent5143a47a8165b6d7b7f634025901804ab1c0e2c7 (diff)
downloadsystemd-7081db294c817db37e6db472bd5e15c670bdcdd3.tar.gz
ukify: PeError → PEError
We don't lowercase acronyms in systemd usually. Remove unnused f'' prefix to avoid a pylint warning.
Diffstat (limited to 'src/ukify')
-rwxr-xr-xsrc/ukify/ukify.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py
index 033acba3d7..abf34ed071 100755
--- a/src/ukify/ukify.py
+++ b/src/ukify/ukify.py
@@ -44,15 +44,15 @@ import pefile
__version__ = '{{PROJECT_VERSION}} ({{GIT_VERSION}})'
EFI_ARCH_MAP = {
- # host_arch glob : [efi_arch, 32_bit_efi_arch if mixed mode is supported]
- 'x86_64' : ['x64', 'ia32'],
- 'i[3456]86' : ['ia32'],
- 'aarch64' : ['aa64'],
- 'arm[45678]*l' : ['arm'],
- 'loongarch32' : ['loongarch32'],
- 'loongarch64' : ['loongarch64'],
- 'riscv32' : ['riscv32'],
- 'riscv64' : ['riscv64'],
+ # host_arch glob : [efi_arch, 32_bit_efi_arch if mixed mode is supported]
+ 'x86_64' : ['x64', 'ia32'],
+ 'i[3456]86' : ['ia32'],
+ 'aarch64' : ['aa64'],
+ 'arm[45678]*l' : ['arm'],
+ 'loongarch32' : ['loongarch32'],
+ 'loongarch64' : ['loongarch64'],
+ 'riscv32' : ['riscv32'],
+ 'riscv64' : ['riscv64'],
}
EFI_ARCHES: list[str] = sum(EFI_ARCH_MAP.values(), [])
@@ -451,7 +451,7 @@ def pairwise(iterable):
return zip(a, b)
-class PeError(Exception):
+class PEError(Exception):
pass
@@ -493,12 +493,12 @@ def pe_add_sections(uki: UKI, output: str):
warnings = pe.get_warnings()
if warnings:
- raise PeError(f'pefile warnings treated as errors: {warnings}')
+ raise PEError(f'pefile warnings treated as errors: {warnings}')
security = pe.OPTIONAL_HEADER.DATA_DIRECTORY[pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_SECURITY']]
if security.VirtualAddress != 0:
# We could strip the signatures, but why would anyone sign the stub?
- raise PeError(f'Stub image is signed, refusing.')
+ raise PEError('Stub image is signed, refusing.')
for section in uki.sections:
new_section = pefile.SectionStructure(pe.__IMAGE_SECTION_HEADER_format__, pe=pe)
@@ -506,7 +506,7 @@ def pe_add_sections(uki: UKI, output: str):
offset = pe.sections[-1].get_file_offset() + new_section.sizeof()
if offset + new_section.sizeof() > pe.OPTIONAL_HEADER.SizeOfHeaders:
- raise PeError(f'Not enough header space to add section {section.name}.')
+ raise PEError(f'Not enough header space to add section {section.name}.')
data = section.content.read_bytes()