run pyupgrade to upgrade the codebase to python3.6

This commit is contained in:
Kovid Goyal
2021-10-21 12:43:55 +05:30
parent 8f0b3983ee
commit 6546c1da9b
159 changed files with 194 additions and 353 deletions
+2 -3
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
import os
@@ -294,7 +293,7 @@ def bash_output_serializer(ans: Completions) -> str:
for word in matches:
if matches.trailing_space:
word += ' '
lines.append('COMPREPLY+=({})'.format(shlex.quote(word)))
lines.append(f'COMPREPLY+=({shlex.quote(word)})')
# debug('\n'.join(lines))
return '\n'.join(lines)
@@ -685,7 +684,7 @@ def main(args: Sequence[str], entry_points: Iterable[str], namespaced_entry_poin
parser = parsers[cstyle]
serializer = serializers[cstyle]
except KeyError:
raise SystemExit('Unknown completion style: {}'.format(cstyle))
raise SystemExit(f'Unknown completion style: {cstyle}')
words, new_word = parser(data)
ans = find_completions(words, new_word, entry_points, namespaced_entry_points)
print(serializer(ans), end='')