File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,6 +413,24 @@ def run(self) -> int:
413413 self .display_pre_message ()
414414 self .ensure_directories ()
415415
416+ def _is_self_upgrade_supported (x ):
417+ mx = self .VERSION_REGEX .match (x )
418+ vx = tuple (int (p ) for p in mx .groups ()[:3 ]) + (mx .group (5 ),)
419+ return vx >= (1 , 2 , 0 )
420+
421+ if not _is_self_upgrade_supported (version ):
422+ self ._write (
423+ colorize (
424+ "warning" ,
425+ f"You are installing { version } . When using the current installer, this version does not support "
426+ f"updating using the 'self update' command. Please use 1.2.0a1 or later." ,
427+ )
428+ )
429+ if not self ._accept_all :
430+ continue_install = input ("Do you want to continue? ([y]/n) " ) or "y"
431+ if continue_install .lower () in {"n" , "no" }:
432+ return 0
433+
416434 try :
417435 self .install (version )
418436 except subprocess .CalledProcessError as e :
You can’t perform that action at this time.
0 commit comments