1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-27 14:34:06 +02:00

gnu: nmap: Fix tests under python@3.12.

* gnu/packages/admin.scm (nmap)[arguments]<#:phases>:
Add phase 'fix-tests-for-python-3.12.

Change-Id: I9f4aa9fceca2d922e00b6305878e137644c2a39f
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves
2026-02-07 21:33:41 +01:00
committed by Sharlatan Hellseher
parent e223c11008
commit 01ed06fac4
+12
View File
@@ -3927,6 +3927,18 @@ rules is done with the @code{auditctl} utility.")
(wrap-program (string-append ndiff "/bin/ndiff")
`("GUIX_PYTHONPATH" prefix
(,(python-path ndiff)))))))
(add-before 'check 'fix-tests-for-python-3.12
(lambda _
(substitute* "ndiff/ndifftest.py"
(("import imp")
"import importlib.util")
(("ndiff = imp\\.load_source\\(\"ndiff\", \"ndiff\\.py\"\\)")
(string-join
'("spec = \
importlib.util.spec_from_file_location(\"ndiff\", \"ndiff.py\")"
"ndiff = importlib.util.module_from_spec(spec)"
"spec.loader.exec_module(ndiff)")
"\n")))))
;; These are the tests that do not require network access.
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)