Skip to content

Commit

Permalink
Merge pull request #69 from yves-chevallier/master
Browse files Browse the repository at this point in the history
Deprecated pkg_resources: replaced with importlib in utils.py
  • Loading branch information
boisgera authored Jul 26, 2024
2 parents 7085c47 + 0ff4f6e commit d59e06a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions src/pandoc/types.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# coding: utf-8

# Python 3 Standard Library
import builtins
import collections
import inspect
import pydoc
import sys

# Third-Party Libraries
import pkg_resources

# Pandoc
import pandoc
import pandoc.utils

Expand Down
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 d59e06a

Please sign in to comment.