From 05baf008998374c75c87a880d30ef7c62a92319d Mon Sep 17 00:00:00 2001 From: Noam Yorav-Raphael Date: Tue, 19 Nov 2024 23:55:17 +0200 Subject: [PATCH] ponysay: fix SyntaxWarning Currently when running ponysay, you get this warning twice: ``` /nix/store/.../bin/ponysay/balloon.py:43: SyntaxWarning: invalid escape sequence '\-' ``` It is caused by a docstring containing twice the phrase `\-directional`. The fix is just to make it a raw string (replace `'''` with `r'''`). --- pkgs/by-name/po/ponysay/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/po/ponysay/package.nix b/pkgs/by-name/po/ponysay/package.nix index 0b374e1efba1..f58d78285d7f 100644 --- a/pkgs/by-name/po/ponysay/package.nix +++ b/pkgs/by-name/po/ponysay/package.nix @@ -23,6 +23,9 @@ stdenv.mkDerivation rec { substituteInPlace setup.py --replace \ "fileout.write(('#!/usr/bin/env %s\n' % env).encode('utf-8'))" \ "fileout.write(('#!%s/bin/%s\n' % (os.environ['python3'], env)).encode('utf-8'))" + substituteInPlace src/balloon.py --replace-fail \ + $'\'\'\'\n Constructor' \ + $'r\'\'\'\n Constructor' python3 setup.py --prefix=$out --freedom=partial install \ --with-shared-cache=$out/share/ponysay \ --with-bash