Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: tolerate missing termcolor #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WoeUSB/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
try:
import termcolor
except ImportError:
termcolor = None
print("Module termcolor is not installed, text coloring disabled")
no_color = True

gui = None
verbose = False
Expand Down Expand Up @@ -289,7 +289,7 @@ def print_with_color(text, color=""):
gui.error = text
sys.exit()
else:
if no_color or color == "":
if no_color or color == "" or termcolor is None:
sys.stdout.write(text + "\n")
else:
termcolor.cprint(text, color)
Expand Down