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

Commit 5e431095 authored by Cole Faust's avatar Cole Faust
Browse files

Make mkstrip always return a string

This is what mk2rbc assumes, and previously that
assumption was incorrect when passing a list to
mkstrip.

Bug: 226974242
Test: Presubmits
Change-Id: I7b1596662df7c966404aab2a99d7c2e53d917bd6
parent 5f6235e5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -767,8 +767,11 @@ def _mkstrip(s):
    That is, removes string's leading and trailing whitespace characters and
    replaces any sequence of whitespace characters with with a single space.
    """
    if type(s) != "string":
        return s
    t = type(s)
    if t == "list":
        s = " ".join(s)
    elif t != "string":
        fail("Argument to mkstrip must be a string or list.")
    result = ""
    was_space = False
    for ch in s.strip().elems():