diff --git a/pkgs/development/python-modules/pyasynchat/default.nix b/pkgs/development/python-modules/pyasynchat/default.nix index 2472b2ef68b6..b8f7cd764133 100644 --- a/pkgs/development/python-modules/pyasynchat/default.nix +++ b/pkgs/development/python-modules/pyasynchat/default.nix @@ -5,6 +5,7 @@ setuptools, pyasyncore, pytestCheckHook, + pythonOlder, }: buildPythonPackage rec { @@ -29,6 +30,17 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + preCheck = + if (pythonOlder "3.11") then + '' + substituteInPlace tests/test_asynchat.py \ + --replace-fail "asynchat = warnings_helper.import_deprecated('asynchat')" 'import asynchat' \ + --replace-fail "asyncore = warnings_helper.import_deprecated('asyncore')" 'import asyncore' \ + --replace-fail 'support.requires_working_socket(module=True)' "" + '' + else + null; + pythonImportsCheck = [ "asynchat" ];