mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-26 05:04:34 +00:00
Mock colorama if it isn't installed
This commit is contained in:
parent
d7acf9dbb0
commit
dbfcaf7be5
|
@ -5,7 +5,13 @@ import sys
|
|||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import colorama
|
||||
except ImportError:
|
||||
from unittest.mock import Mock
|
||||
class NoReprMock(Mock):
|
||||
__repr__ = lambda self: ""
|
||||
colorama = NoReprMock()
|
||||
|
||||
colorama.init(autoreset=True)
|
||||
|
||||
|
|
Loading…
Reference in a new issue