@@ -60,7 +60,7 @@ def check_announcements():
6060 raise Error (res .text .strip ())
6161
6262
63- def check_version (package_name = __package__ , timeout = 15 ):
63+ def check_version (package_name = __package__ , timeout = 30 ):
6464 """Check that submit50 is the latest version according to submit50.io."""
6565 if not __version__ :
6666 return
@@ -69,7 +69,7 @@ def check_version(package_name=__package__, timeout=15):
6969 res = requests .get (f"{ SUBMIT_URL } /versions/submit50" , timeout = timeout )
7070 if res .status_code != 200 :
7171 raise Error (_ ("Could not connect to submit.cs50.io."
72- "Please visit our status page https://cs50.statuspage.io for more information." ))
72+ "Please visit our status page https://cs50.statuspage.io for more information." ))
7373
7474 # Get submit.cs50.io version
7575 latest_io = version .parse (res .text .strip ())
@@ -84,15 +84,11 @@ def check_version(package_name=__package__, timeout=15):
8484
8585 # Check for minimum requirement
8686 if current < latest_io :
87- pass
87+ raise Error ( _ ( f"v { current } of { package_name } is no longer supported. Run pip3 install --upgrade { package_name } to upgrade." ))
8888
8989 # Check for latest version
9090 if latest_pypi > current or latest_io > current :
91- raise Error (_ (f"A newer version of { package_name } is available. Run pip3 install --upgrade { package_name } to upgrade." ))
92-
93- # Resolve if submit.cs50.io version differs from PyPi
94- if latest_pypi != latest_io :
95- pass
91+ cprint (f"A newer version of { package_name } is available. Run pip3 install --upgrade { package_name } to upgrade." , "magenta" )
9692
9793
9894def setup_logging (level ):
0 commit comments