Skip to content

Commit

Permalink
Upgrade Python syntax with pyupgrade --py36-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 29, 2024
1 parent d11dcbe commit 50ad021
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bin/wcwidth-browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#: printable length of highest unicode character description
LIMIT_UCS = 0x3fffd
UCS_PRINTLEN = len('{value:0x}'.format(value=LIMIT_UCS))
UCS_PRINTLEN = len(f'{LIMIT_UCS:0x}')


def readline(term, width):
Expand Down Expand Up @@ -566,10 +566,10 @@ def draw_status(self, writer, idx):
if idx == self.last_page:
last_end = '(END)'
else:
last_end = '/{}'.format(self.last_page)
last_end = f'/{self.last_page}'
txt = ('Page {idx}{last_end} - '
'{q} to quit, [keys: {keyset}]'
.format(idx=style.attr_minor('{}'.format(idx)),
.format(idx=style.attr_minor(f'{idx}'),
last_end=style.attr_major(last_end),
keyset=style.attr_major('kjfbvc12-='),
q=style.attr_minor('q')))
Expand Down
2 changes: 1 addition & 1 deletion bin/wcwidth-libc-comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def report_ucs_msg(ucs, wcwidth_libc, wcwidth_local):
.decode('ascii')
.upper()
.lstrip('0'))
url = "http://codepoints.net/U+{}".format(ucp)
url = f"http://codepoints.net/U+{ucp}"
name = unicodedata.name(ucs)
return ("libc,ours={},{} [--o{}o--] name={} val={} {}"
" ".format(wcwidth_libc, wcwidth_local, ucs, name, ord(ucs), url))
Expand Down

0 comments on commit 50ad021

Please sign in to comment.