* remove unnecessary casting in f-string
* merge nested condition
except RequestError as exc:
console = rich.console.Console()
- console.print(f"[red]{type(exc).__name__}[/red]: {str(exc)}")
+ console.print(f"[red]{type(exc).__name__}[/red]: {exc}")
sys.exit(1)
sys.exit(0 if response.is_success else 1)
fileobj = value
content_type = guess_content_type(filename)
- if isinstance(fileobj, str) or isinstance(fileobj, io.StringIO):
+ if isinstance(fileobj, (str, io.StringIO)):
raise TypeError(f"Expected bytes or bytes-like object got: {type(fileobj)}")
self.filename = filename