diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index d9e06c0c08..e2eae14064 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)