From 9871d999bb911c81d1772747cf155baefad4dd49 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sat, 18 Apr 2015 23:04:48 +0200 Subject: [PATCH] mpd: Replace filterwarnings with deprecation helper --- mopidy/mpd/protocol/music_db.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mopidy/mpd/protocol/music_db.py b/mopidy/mpd/protocol/music_db.py index 0e59706f..0350fc21 100644 --- a/mopidy/mpd/protocol/music_db.py +++ b/mopidy/mpd/protocol/music_db.py @@ -2,7 +2,6 @@ from __future__ import absolute_import, unicode_literals import functools import itertools -import warnings from mopidy.models import Track from mopidy.mpd import exceptions, protocol, translator @@ -174,10 +173,9 @@ def findadd(context, *args): results = context.core.library.search(query=query, exact=True).get() - with warnings.catch_warnings(): + with deprecation.ignore('core.tracklist.add:tracks_arg'): # TODO: for now just use tracks as other wise we have to lookup the # tracks we just got from the search. - warnings.filterwarnings('ignore', 'tracklist.add.*"tracks" argument.*') context.core.tracklist.add(tracks=_get_tracks(results)).get() @@ -452,10 +450,9 @@ def searchadd(context, *args): results = context.core.library.search(query).get() - with warnings.catch_warnings(): + with deprecation.ignore('core.tracklist.add:tracks_arg'): # TODO: for now just use tracks as other wise we have to lookup the # tracks we just got from the search. - warnings.filterwarnings('ignore', 'tracklist.add.*"tracks".*') context.core.tracklist.add(_get_tracks(results)).get()