mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Don't hardcode errno constant
The value of ENOENT is architecture-dependent, so don't assume it's always 2.
This commit is contained in:
parent
80f77aea4d
commit
95a868bb50
1 changed files with 3 additions and 2 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
from __future__ import division, absolute_import, print_function
|
||||
|
||||
import errno
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
|
|
@ -142,8 +143,8 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
|
|||
try:
|
||||
os.remove(filename)
|
||||
except OSError as e:
|
||||
# errno 2 means file does not exist, just ignore this error.
|
||||
if e.errno != 2:
|
||||
# ENOENT means file does not exist, just ignore this error.
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
def _submit_data(self, item, data):
|
||||
|
|
|
|||
Loading…
Reference in a new issue