Skip to content

Commit

Permalink
filters: use importlib_resources API to avoid deprecation warning
Browse files Browse the repository at this point in the history
Fix deprecation warning "pkg_resources is deprecated as an API"
  • Loading branch information
polariton committed Dec 19, 2023
1 parent 1d1a08a commit 77441a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resampy/filters.py
Expand Up @@ -47,7 +47,7 @@

import numpy as np
import os
import pkg_resources
import importlib_resources
import sys

FILTER_FUNCTIONS = ['sinc_window']
Expand Down Expand Up @@ -206,7 +206,7 @@ def load_filter(filter_name):
fname = os.path.join('data',
os.path.extsep.join([filter_name, 'npz']))

data = np.load(pkg_resources.resource_filename(__name__, fname))
data = np.load(importlib_resources.files(__name__).joinpath(fname))
FILTER_CACHE[filter_name] = data['half_window'], data['precision'], data['rolloff']

return FILTER_CACHE[filter_name]
Expand Down

0 comments on commit 77441a8

Please sign in to comment.