Skip to content

Commit

Permalink
Fix unit tests in Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mofojed committed Mar 20, 2024
1 parent 7d87e6f commit d0032be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/json/test/test_json_plugin.py
Original file line number Diff line number Diff line change
@@ -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()


Expand Down

0 comments on commit d0032be

Please sign in to comment.