guix_mirror_bot pushed a commit to branch python-team
in repository guix.
commit e8b731ad3595422c19692d6198ac70bfbd9390ef
Author: Nicolas Graves <[email protected]>
AuthorDate: Sat Feb 7 21:33:41 2026 +0100
gnu: nmap: Fix tests under [email protected].
* gnu/packages/admin.scm (nmap)[arguments]<#:phases>:
Add phase 'fix-tests-for-python-3.12.
Change-Id: I9f4aa9fceca2d922e00b6305878e137644c2a39f
Signed-off-by: Sharlatan Hellseher <[email protected]>
---
gnu/packages/admin.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 623ec7e09f..b518f61774 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -3909,6 +3909,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)