diff --git a/beetsplug/random.py b/beetsplug/random.py index f50061bfb..57ac77e79 100644 --- a/beetsplug/random.py +++ b/beetsplug/random.py @@ -40,7 +40,9 @@ def random_item(lib, opts, args): # Group the objects by artist so we can sample from them. key = attrgetter('albumartist') objs.sort(key=key) - objs_by_artists = {artist: list(v) for artist, v in groupby(objs, key)} + objs_by_artists = {} + for artist, v in groupby(objs, key): + objs_by_artists[artist] = list(v) objs = [] for _ in range(opts.number): diff --git a/docs/changelog.rst b/docs/changelog.rst index cec83fcbd..10da2d637 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,8 @@ And some bug fixes: * :doc:`/plugins/scrub`: Handle and log I/O errors. * :doc:`/plugins/lyrics`: The Google backend should now turn up more results. Thanks to Fabrice Laporte. +* :doc:`/plugins/random`: Fix compatibility with Python 2.6. Thanks to + Matthias Drochner. 1.2.0 (June 5, 2013)