[PATCH] D46773: [lit] Fix several tests that fail when using Python 3 or on Windows

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 14:01:45 PDT 2018


No it's fine, I was just thinking out loud.

On Mon, May 14, 2018 at 12:55 PM Stella Stamenova via Phabricator <
reviews at reviews.llvm.org> wrote:

> stella.stamenova added inline comments.
>
>
> ================
> Comment at:
> packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py:281-285
> +                # In Python 2, sockets return byte strings. In Python 3,
> sockets return bytes.
> +                # If we got bytes (and not a byte string), decode them to
> a string for later handling.
> +                if isinstance(data, bytes) and not isinstance(data, str):
> +                    data = data.decode()
> +                self._receive(data)
> ----------------
> zturner wrote:
> > It's a shame that we're not using lit here.  lit has a nice function
> `lit.util.to_string` which handles this (and one other strange edge case)
> correctly.
> I looked into using it - but currently none of the lldb tests use
> functionality from lit and I don't think there's a good way to do so. Let
> me know if you have a suggestion, but otherwise, I think this is the least
> impactful change that fixes the tests.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D46773
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180514/66100528/attachment.html>


More information about the llvm-commits mailing list