mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 06:22:48 +01:00
python 2.6 compatibility
This commit is contained in:
parent
a5422eeaf7
commit
3229c59b60
1 changed files with 5 additions and 2 deletions
|
|
@ -472,10 +472,13 @@ class Item(LibModel):
|
|||
|
||||
for key in ITEM_KEYS_META:
|
||||
value = getattr(f, key)
|
||||
if isinstance(value, (int, long)) and value.bit_length() > 63:
|
||||
if isinstance(value, (int, long)):
|
||||
# Filter values wider than 64 bits (in signed
|
||||
# representation). SQLite cannot store them.
|
||||
value = 0
|
||||
# py26: Post transition, we can use:
|
||||
# value.bit_length() > 63
|
||||
if abs(value) >= 2 ** 63:
|
||||
value = 0
|
||||
setattr(self, key, value)
|
||||
|
||||
# Database's mtime should now reflect the on-disk value.
|
||||
|
|
|
|||
Loading…
Reference in a new issue