summaryrefslogtreecommitdiff
path: root/src/ukify
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-11-25 19:14:42 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-12-07 15:53:47 +0100
commit1f6da5d902ef192c7fe24ffd4ebb3b9e1f2ecda8 (patch)
tree903249eeaee1829081043bce264c8db6d245e0a7 /src/ukify
parent0fdf4e181025b98df2e52ff3c861dc35d0412b8c (diff)
downloadsystemd-1f6da5d902ef192c7fe24ffd4ebb3b9e1f2ecda8.tar.gz
ci: install pefile
Diffstat (limited to 'src/ukify')
-rwxr-xr-xsrc/ukify/test/test_ukify.py6
-rwxr-xr-xsrc/ukify/ukify.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ukify/test/test_ukify.py b/src/ukify/test/test_ukify.py
index a4afa56ad9..48ffc6d495 100755
--- a/src/ukify/test/test_ukify.py
+++ b/src/ukify/test/test_ukify.py
@@ -20,6 +20,12 @@ try:
except ImportError:
sys.exit(77)
+try:
+ # pyflakes: noqa
+ import pefile # noqa
+except ImportError:
+ sys.exit(77)
+
# We import ukify.py, which is a template file. But only __version__ is
# substituted, which we don't care about here. Having the .py suffix makes it
# easier to import the file.
diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py
index d4772d2bae..83423fc720 100755
--- a/src/ukify/ukify.py
+++ b/src/ukify/ukify.py
@@ -20,7 +20,6 @@ import subprocess
import tempfile
import typing
-import pefile
__version__ = '{{GIT_VERSION}}'
@@ -66,6 +65,8 @@ def shell_join(cmd):
def pe_executable_size(filename):
+ import pefile
+
pe = pefile.PE(filename)
section = pe.sections[-1]
return section.VirtualAddress + section.Misc_VirtualSize