Skip to content

Commit

Permalink
ponysay: fix SyntaxWarning
Browse files Browse the repository at this point in the history
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'''`).
  • Loading branch information
noamraph committed Nov 19, 2024
1 parent 0634959 commit 05baf00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkgs/by-name/po/ponysay/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05baf00

Please sign in to comment.