Skip to content

Commit

Permalink
update getDataPath to importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Sep 30, 2024
1 parent 9148b47 commit 0c6e55e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions prody/utilities/misctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,9 @@ def pystr(a):
return b

def getDataPath(filename):
import pkg_resources
return pkg_resources.resource_filename('prody.utilities', 'datafiles/%s'%filename)
import importlib
path = importlib.util.find_spec('prody.utilities.datafiles').submodule_search_locations[0]
return '%s/%s' %(path, filename)

def openData(filename, mode='r'):
return open(getDataPath(filename), mode)
Expand Down

0 comments on commit 0c6e55e

Please sign in to comment.