Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Only install colorama on Windows #249

Merged
merged 1 commit into from
Nov 4, 2021
Merged

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented Sep 17, 2021

As colorama is only initialized on Windows (#238), it should not be installed on Linux or MacOS.

@@ -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.

@@ -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).

@jiasli jiasli requested a review from evelyn-ys November 3, 2021 09:32
@jiasli
Copy link
Member Author

jiasli commented Nov 3, 2021

/azp run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants