Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1db284ff authored by Andrew Chant's avatar Andrew Chant Committed by android-build-merger
Browse files

Merge "Catch unicode decode errors search for kernel ver"

am: 2b4828a5

Change-Id: Ieed4020a6490d44c4be1780eec08e501ed1e2219
parents 09f64c0c 2b4828a5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -47,7 +47,10 @@ def get_version(input_bytes, start_idx):
  null_idx = input_bytes.find('\x00', start_idx)
  if null_idx < 0:
    return None
  try:
    linux_banner = input_bytes[start_idx:null_idx].decode()
  except UnicodeDecodeError:
    return None
  mo = re.match(LINUX_BANNER_REGEX, linux_banner)
  if mo:
    return mo.group(1)