Skip to content

Commit

Permalink
init colorama in az --version to fix issue on windows (#11609)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzhou-msft authored Dec 19, 2019
1 parent d19f2e1 commit c6b5bc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/azure-cli-core/azure/cli/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_cli_version(self):
def show_version(self):
from azure.cli.core.util import get_az_version_string
from azure.cli.core.commands.constants import SURVEY_PROMPT
import colorama
ver_string, updates_available = get_az_version_string()
print(ver_string)
if updates_available == -1:
Expand All @@ -97,7 +98,9 @@ def show_version(self):
else:
print('Your CLI is up-to-date.')

colorama.init() # This could be removed when knack fix is released
print('\n' + SURVEY_PROMPT)
colorama.deinit() # This could be removed when knack fix is released

def exception_handler(self, ex): # pylint: disable=no-self-use
from azure.cli.core.util import handle_exception
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
'azure-mgmt-servicebus~=0.6.0',
'azure-mgmt-servicefabric~=0.2.0',
'azure-mgmt-signalr~=0.3.0',
'azure-mgmt-sql~=0.15',
'azure-mgmt-sql~=0.15.0',
'azure-mgmt-sqlvirtualmachine~=0.4.0',
'azure-mgmt-storage~=5.0.0',
'azure-mgmt-trafficmanager~=0.51.0',
Expand Down

0 comments on commit c6b5bc6

Please sign in to comment.