Skip to content

Commit feb06b6

Browse files
committed
updates for 2024
1 parent 1785107 commit feb06b6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

resampy/filters.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@
4646
'''
4747

4848
import numpy as np
49-
import importlib_resources
5049
import sys
5150

51+
try:
52+
# Try to import from the standard library first (Python >= 3.9)
53+
from importlib import resources as importlib_resources
54+
except ImportError:
55+
# Fall back to the backport
56+
import importlib_resources
57+
58+
5259
FILTER_FUNCTIONS = ['sinc_window']
5360
FILTER_CACHE = dict()
5461

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ python_requires >= 3.6
4343
install_requires =
4444
numpy>=1.17
4545
numba>=0.53
46-
importlib_resources; python_verssion < "3.9"
46+
importlib_resources; python_version < "3.9"
4747

4848
[options.package_data]
4949
resampy = data/*

tests/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_good_window():
141141
sr_orig = 100
142142
sr_new = 200
143143
x = np.random.randn(500)
144-
y = resampy.resample(x, sr_orig, sr_new, filter='sinc_window', window=scipy.signal.blackman)
144+
y = resampy.resample(x, sr_orig, sr_new, filter='sinc_window', window=scipy.signal.windows.blackman)
145145

146146
assert len(y) == 2 * len(x)
147147

0 commit comments

Comments
 (0)