Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion knack/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(self,
self.only_show_errors = self.config.getboolean('core', 'only_show_errors', fallback=False)
self.enable_color = self._should_enable_color()
# Init colorama only in Windows legacy terminal
self._should_init_colorama = self.enable_color and os.name == 'nt' and not is_modern_terminal()
self._should_init_colorama = self.enable_color and sys.platform == 'win32' and not is_modern_terminal()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same method as setup.py to detect system.


@staticmethod
def _should_show_version(args):
Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from codecs import open
Copy link
Member Author

@jiasli jiasli Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for Python 2 which has been dropped long time ago (#233).

from setuptools import setup, find_packages
import sys
from setuptools import setup

VERSION = '0.8.2'

DEPENDENCIES = [
'argcomplete',
'colorama',
'jmespath',
'pygments',
'pyyaml',
'tabulate'
]

with open('README.rst', 'r', encoding='utf-8') as f:
# On Windows, colorama is required for legacy terminals.
if sys.platform == 'win32':
DEPENDENCIES.append('colorama')

with open('README.rst', 'r') as f:
README = f.read()

setup(
Expand Down