diff --git a/beets/autotag/match.py b/beets/autotag/match.py index b7ab0bacb..0279e27f0 100644 --- a/beets/autotag/match.py +++ b/beets/autotag/match.py @@ -15,6 +15,8 @@ """Matches existing metadata with canonical information to identify releases and tracks. """ +from __future__ import division + import logging import re from munkres import Munkres diff --git a/beets/util/__init__.py b/beets/util/__init__.py index f5bf6c031..1eaead9d0 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -13,6 +13,8 @@ # included in all copies or substantial portions of the Software. """Miscellaneous utility functions.""" +from __future__ import division + import os import sys import re @@ -149,7 +151,7 @@ def components(path, pathmod=None): comp = pathmod.basename(anc) if comp: comps.append(comp) - else: # root + else: # root comps.append(anc) last = pathmod.basename(path) @@ -337,10 +339,10 @@ def sanitize_for_path(value, pathmod, key=None): value = u'%02i' % (value or 0) elif key == 'bitrate': # Bitrate gets formatted as kbps. - value = u'%ikbps' % ((value or 0) / 1000) + value = u'%ikbps' % ((value or 0) // 1000) elif key == 'samplerate': # Sample rate formatted as kHz. - value = u'%ikHz' % ((value or 0) / 1000) + value = u'%ikHz' % ((value or 0) // 1000) else: value = unicode(value) return value