diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index 610313302ad8..73e013d00af8 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -60,6 +60,11 @@ buildPythonPackage { # postPatch = '' sed -i "/extra_compile_args.append('-std=c++14')/d" setup.py + + # The former function has been renamed into the latter in Python 3.12. + # Does not apply to all protobuf versions, hence --replace-warn. + substituteInPlace google/protobuf/internal/json_format_test.py \ + --replace-warn assertRaisesRegexp assertRaisesRegex ''; nativeBuildInputs = lib.optional isPyPy tzdata;