Skip to content

Commit 82a85fb

Browse files
authored
{Upgrade} Fix KeyError: 'pypi' when auto upgrade (#26106)
1 parent 78ae7c0 commit 82a85fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/azure-cli/azure/cli/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def cli_main(cli, args):
7272
if datetime.datetime.now() > version_update_time + datetime.timedelta(days=11):
7373
get_cached_latest_versions()
7474
from packaging.version import parse
75-
if parse(VERSIONS['versions']['core']['local']) < parse(VERSIONS['versions']['core']['pypi']): # pylint: disable=line-too-long
75+
if 'pypi' in VERSIONS['versions']['core'] and parse(VERSIONS['versions']['core']['local']) < parse(VERSIONS['versions']['core']['pypi']): # pylint: disable=line-too-long
7676
import subprocess
7777
import platform
7878
from azure.cli.core.azclierror import UnclassifiedUserFault # pylint: disable=ungrouped-imports

0 commit comments

Comments
 (0)