forked from extern/httpie-cli
Modernize the code base with f-strings (#1068)
This commit is contained in:
committed by
GitHub
parent
39314887c4
commit
0ff0874fa3
@ -62,7 +62,7 @@ def humanize_bytes(n, precision=2):
|
||||
break
|
||||
|
||||
# noinspection PyUnboundLocalVariable
|
||||
return '%.*f %s' % (precision, n / factor, suffix)
|
||||
return f'{n / factor:.{precision}f} {suffix}'
|
||||
|
||||
|
||||
class ExplicitNullAuth(requests.auth.AuthBase):
|
||||
@ -85,7 +85,7 @@ def get_content_type(filename):
|
||||
if mime:
|
||||
content_type = mime
|
||||
if encoding:
|
||||
content_type = '%s; charset=%s' % (mime, encoding)
|
||||
content_type = f'{mime}; charset={encoding}'
|
||||
return content_type
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user