diff: remove dead legacy code

West requires python 3.8 or later now. No need to test for 3.6 or
earlier.

I've never received any reports of the ValueError happening for other
versions of Python, so it seems safe to remove the exception handling
as well. If people haven't been reporting, we'll get bug reports soon.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2023-03-10 11:14:00 -08:00 committed by Marti Bolivar
parent 2d1a4ca7f6
commit 5b182c8602
1 changed files with 0 additions and 18 deletions

View File

@ -670,15 +670,6 @@ class Status(_ProjectCommand):
# to print. We manually use Popen in order to try to exit as
# quickly as possible if 'git status' prints anything.
# This technique fails when tested on Python 3.6, which west
# still supports at time of writing. This seems likely to be
# due to https://bugs.python.org/issue35182.
#
# Users of old python versions will have to deal with the
# verbose output.
if sys.version_info < (3, 7):
return True
popen = subprocess.Popen(['git', 'status', '--porcelain'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
@ -693,15 +684,6 @@ class Status(_ProjectCommand):
stdout, stderr = popen.communicate(timeout=0.1)
except subprocess.TimeoutExpired:
pass
except ValueError:
# In case this isn't issue35182, handle the exception
# anyway.
self.wrn(
f'{project.name}: internal error; got ValueError '
'from Popen.communicate() when checking status. '
'Ignoring it, but please report this to the west '
'developers.')
return True
return stdout or stderr
while True: