Skip to content

Commit

Permalink
Only call colorama.init if colorama is available
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Dec 12, 2022
1 parent 6525008 commit c752a6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion isort/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def create_terminal_printer(
print(no_colorama_message, file=sys.stderr)
sys.exit(1)

colorama.init(strip=False)
if not colorama_unavailable:
colorama.init(strip=False)
return (
ColoramaPrinter(error, success, output) if color else BasicPrinter(error, success, output)
)

0 comments on commit c752a6c

Please sign in to comment.