Skip to content

Commit 25f3921

Browse files
committed
update deprecated use of pkg_resources
fix #75
1 parent 225ec81 commit 25f3921

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

MDAnalysisData/base.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from os import environ, listdir, makedirs
3232
from os.path import dirname, exists, expanduser, isdir, join, splitext
3333
import hashlib
34-
from pkg_resources import resource_string
34+
import importlib.resources
3535

3636
from tqdm import tqdm
3737

@@ -207,9 +207,8 @@ def _read_description(filename, description_dir='descr'):
207207
"""
208208
# The descr directory should be in the same directory as this file base.py.
209209
# `resource_string` returns bytes, which we need to decode to UTF-8
210-
DESCR = resource_string(__name__,
211-
'{}/{}'.format(description_dir, filename)
212-
).decode("utf-8")
210+
path = importlib.resources.files(__name__) / description_dir / filename
211+
DESCR = path.read_bytes().decode("utf-8")
213212
return DESCR
214213

215214

0 commit comments

Comments
 (0)