diff --git a/pkgs/development/python-modules/python-prctl/default.nix b/pkgs/development/python-modules/python-prctl/default.nix index ffc946a56f54..b4c3731a76cb 100644 --- a/pkgs/development/python-modules/python-prctl/default.nix +++ b/pkgs/development/python-modules/python-prctl/default.nix @@ -4,6 +4,7 @@ fetchPypi, libcap, pytestCheckHook, + distutils, }: buildPythonPackage rec { @@ -18,7 +19,17 @@ buildPythonPackage rec { buildInputs = [ libcap ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + distutils + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace test_prctl.py \ + --replace-fail \ + 'sys.version[0:3]' \ + '"cpython-%d%d" % (sys.version_info.major, sys.version_info.minor)' + ''; disabledTests = [ # Intel MPX support was removed in GCC 9.1 & Linux kernel 5.6