From b0bf7bb047bbc6c993343ebe71ec6d42721e1b37 Mon Sep 17 00:00:00 2001 From: Thomas Orozco Date: Wed, 7 Sep 2022 02:49:15 -0700 Subject: [PATCH] buck: fix a broken test Summary: Like it says in the title. Looks like `__loader__.get_data` returns bytes on Windows. Just open the file normally instead. Reviewed By: ndmitchell fbshipit-source-id: d47c1b1fe8ebd6929db004f0ccd4af013c130845 --- .../python/testdata/python_binary/cxx_resources/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/com/facebook/buck/features/python/testdata/python_binary/cxx_resources/main.py b/test/com/facebook/buck/features/python/testdata/python_binary/cxx_resources/main.py index c95382c7bcb..ce407b693c2 100644 --- a/test/com/facebook/buck/features/python/testdata/python_binary/cxx_resources/main.py +++ b/test/com/facebook/buck/features/python/testdata/python_binary/cxx_resources/main.py @@ -1,4 +1,5 @@ import os +import sys want = "hello world!\n" @@ -6,4 +7,7 @@ os.path.join(os.path.dirname(__file__), "__cxx_resources__", "blah", "foo.dat") ) +if sys.version_info >= (3,): + got = got.decode("utf-8") + assert want == got, "expected {}, got {}".format(repr(want), repr(got))