mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 02:39:40 +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
|
import argparse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import colorama
|
try:
|
||||||
|
import colorama
|
||||||
|
except ImportError:
|
||||||
|
from unittest.mock import Mock
|
||||||
|
class NoReprMock(Mock):
|
||||||
|
__repr__ = lambda self: ""
|
||||||
|
colorama = NoReprMock()
|
||||||
|
|
||||||
colorama.init(autoreset=True)
|
colorama.init(autoreset=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue