Skip to content

Commit

Permalink
Repkace pkg_resources with importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
yves-chevallier authored Jul 16, 2024
1 parent 7085c47 commit 42ae96e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pandoc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import warnings

# Third-Party Libraries
import pkg_resources
import importlib.resources as resources
import ply.lex as lex
import ply.yacc as yacc


# Pandoc-Types Version Mapping and Type Info
# ------------------------------------------------------------------------------
_json_data = pkg_resources.resource_string("pandoc", "pandoc-types.js")
_json_data = resources.read_text("pandoc", "pandoc-types.js")
if not isinstance(_json_data, str): # resource loaded as bytes in Python 3
_json_data = _json_data.decode("utf-8")
_data = json.loads(_json_data)
Expand Down

0 comments on commit 42ae96e

Please sign in to comment.