Skip to content

Commit

Permalink
buck: fix a broken test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
krallin authored and facebook-github-bot committed Sep 7, 2022
1 parent 3207b10 commit b0bf7bb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import os
import sys

want = "hello world!\n"

got = __loader__.get_data(
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))

0 comments on commit b0bf7bb

Please sign in to comment.