mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
mediafile: Improve deprecation warning
This is for mediafile what cc8c3529fb was
for confit, cf. https://github.com/beetbox/beets/pull/4263
This commit is contained in:
parent
d72498f429
commit
c657fb6642
1 changed files with 8 additions and 1 deletions
|
|
@ -16,11 +16,18 @@
|
|||
import mediafile
|
||||
|
||||
import warnings
|
||||
warnings.warn("beets.mediafile is deprecated; use mediafile instead")
|
||||
warnings.warn(
|
||||
"beets.mediafile is deprecated; use mediafile instead",
|
||||
# Show the location of the `import mediafile` statement as the warning's
|
||||
# source, rather than this file, such that the offending module can be
|
||||
# identified easily.
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
# Import everything from the mediafile module into this module.
|
||||
for key, value in mediafile.__dict__.items():
|
||||
if key not in ['__name__']:
|
||||
globals()[key] = value
|
||||
|
||||
# Cleanup namespace.
|
||||
del key, value, warnings, mediafile
|
||||
|
|
|
|||
Loading…
Reference in a new issue