Skip to content

Commit

Permalink
fix Python 3.8 lark loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
subbyte committed Oct 9, 2023
1 parent 4c1018d commit 37eb7c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/kestrel_core/src/kestrel/deprecating.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def load_data_file(package_name, file_name):
try:
# resources.files() is introduced in Python 3.9
default_config = resources.files(package_name).joinpath(file_name).read_text()
content = resources.files(package_name).joinpath(file_name).read_text()
except AttributeError:
# Python 3.8; deprecation warning forward
default_config = get_data(package_name, file_name)
content = get_data(package_name, file_name).decode("utf-8")

return default_config
return content

0 comments on commit 37eb7c0

Please sign in to comment.