mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 02:05:30 +08:00
7bb3bf7c74
There were two places in the code that used the anti-pattern of returning True on success else an error message. In python you should always be able to replace `if x == True:` with just `if x:`. Which is what the lint tool recommended. Unfortunately I didn't notice how the return value was being used. This fixes that by changing the two affected functions to return an error message or None on success. This also adds `from __future__ import print_function` since the code uses the `print(msg)` function form rather than the `print msg` statement form. The former works by accident on python2 because the parens are interpreted as creating parenthesized expression that devolves to the single string inside the parens. So while the future import isn't strictly speaking necessary it will help avoid mistakes in the future if more complex `print()` calls are added. Partial fix for #3620 |
||
---|---|---|
.. | ||
completions | ||
functions | ||
groff | ||
tools | ||
__fish_build_paths.fish.in | ||
config.fish |