Skip to content

Commit 476ded3

Browse files
committed
Only require colorama on Windows
1 parent cb63ef4 commit 476ded3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
termcolor
2-
colorama
2+
colorama; sys_platform=='win32'
33
shtab>=1.3.10

tldr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from urllib.request import urlopen, Request
1616
from urllib.error import HTTPError, URLError
1717
from termcolor import colored
18-
import colorama # Required for Windows
1918
import shtab
2019

2120
__version__ = "3.3.0"
@@ -624,7 +623,9 @@ def main() -> None:
624623

625624
options = parser.parse_args()
626625

627-
colorama.init(strip=options.color)
626+
if sys.platform == "win32":
627+
import colorama
628+
colorama.init(strip=options.color)
628629
if options.color is False:
629630
os.environ["FORCE_COLOR"] = "true"
630631

0 commit comments

Comments
 (0)