Skip to content

Commit c752a6c

Browse files
committed
Only call colorama.init if colorama is available
1 parent 6525008 commit c752a6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

isort/format.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def create_terminal_printer(
150150
print(no_colorama_message, file=sys.stderr)
151151
sys.exit(1)
152152

153-
colorama.init(strip=False)
153+
if not colorama_unavailable:
154+
colorama.init(strip=False)
154155
return (
155156
ColoramaPrinter(error, success, output) if color else BasicPrinter(error, success, output)
156157
)

0 commit comments

Comments
 (0)