faroit / stempeg

Python I/O for STEM audio files
https://faroit.github.io/stempeg
MIT License
96 stars 13 forks source link

warnings.warning() does not exist #45

Open jeswan opened 2 years ago

jeswan commented 2 years ago

Bug Description: When using stempeg as part of musdb, I encountered the following error:

        stem_durations = np.array([t.shape[0] for t in stems])
        if not (stem_durations == stem_durations[0]).all():
>           warnings.warning("Stems differ in length and were shortend")
E           AttributeError: module 'warnings' has no attribute 'warning'

/usr/local/lib/python3.9/site-packages/stempeg/read.py:299: AttributeError

warning() does not exist after checking the warnings package.

Suggested Solution: warnings.warning() -> warnings.warn() since warn() exists.

faroit commented 2 years ago

oops. good catch. can fix that next week - you can also provide a PR if you like