File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1018,19 +1018,18 @@ def _venv(state):
10181018 RuntimeWarning ,
10191019 )
10201020 continue
1021- if (
1021+ if should_error :
1022+ if (major , minor ) != sys .version_info [:2 ]:
1023+ raise RuntimeError (
1024+ f"This virtual environment was created for Python { major } .{ minor } , "
1025+ f"but the current interpreter is Python "
1026+ f"{ sys .version_info .major } .{ sys .version_info .minor } . "
1027+ "Consider running `python -m venv --upgrade` to update the environment." ,
1028+ )
1029+ elif (
10221030 major == sys .version_info .major
1023- and minor = = sys .version_info .minor
1031+ and minor ! = sys .version_info .minor
10241032 ):
1025- continue
1026- if should_error :
1027- raise RuntimeError (
1028- f"This virtual environment was created for Python { major } .{ minor } , "
1029- f"but the current interpreter is Python "
1030- f"{ sys .version_info .major } .{ sys .version_info .minor } . "
1031- "Consider running `python -m venv --upgrade` to update the environment." ,
1032- )
1033- else :
10341033 _warn (
10351034 f"This virtual environment was created for Python { major } .{ minor } , "
10361035 f"but the current interpreter is Python "
You can’t perform that action at this time.
0 commit comments