move ENOATTR definition to borg.platform.base

That also gets imported into borg.platform, so
it is easily available from there.
This commit is contained in:
Thomas Waldmann 2025-12-20 18:55:28 +01:00
parent 42e645e6a2
commit 663732c8bd
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
2 changed files with 5 additions and 8 deletions

View file

@ -24,7 +24,11 @@ API_VERSION = "1.2_05"
fdatasync = getattr(os, "fdatasync", os.fsync)
has_posix_fadvise = hasattr(os, "posix_fadvise")
from .xattr import ENOATTR
try:
ENOATTR = errno.ENOATTR # type: ignore[attr-defined]
except AttributeError:
# on some platforms, ENOATTR is missing, use ENODATA there
ENOATTR = errno.ENODATA # type: ignore[attr-defined]
def listxattr(path, *, follow_symlinks=False):

View file

@ -4,13 +4,6 @@ import os
from ..helpers import Buffer
try:
ENOATTR = errno.ENOATTR # type: ignore[attr-defined]
except AttributeError:
# on some platforms, ENOATTR is missing, use ENODATA there
ENOATTR = errno.ENODATA # type: ignore[attr-defined]
buffer = Buffer(bytearray, limit=2**24)