From d0032be4c4cda66c44a9a210eeaf912fe014eb17 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Wed, 20 Mar 2024 12:56:41 -0400 Subject: [PATCH] Fix unit tests in Python 3.8 --- plugins/json/test/test_json_plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/json/test/test_json_plugin.py b/plugins/json/test/test_json_plugin.py index 8507959af..fc3791df0 100644 --- a/plugins/json/test/test_json_plugin.py +++ b/plugins/json/test/test_json_plugin.py @@ -1,12 +1,16 @@ import unittest import importlib.resources import json +import sys from deephaven.plugin.json import Encoder from deephaven.plugin.object_type import Exporter, Reference def read_text(resource: str): + if sys.version_info < (3, 9): + # Need to use legacy behaviour on Python < 3.9 + return importlib.resources.read_text(__package__, resource) return importlib.resources.files(__package__).joinpath(resource).read_bytes()