Merge pull request #3896 from ThomasWaldmann/make-swidth-better-available

make swidth available on all posix platforms, fixes #2667
This commit is contained in:
TW 2018-06-12 22:49:52 +02:00 committed by GitHub
commit 37f2c8944f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 6 deletions

View File

@ -16,18 +16,17 @@ OS_API_VERSION = API_VERSION
if not sys.platform.startswith(('win32', )): if not sys.platform.startswith(('win32', )):
from .posix import process_alive, local_pid_alive from .posix import process_alive, local_pid_alive
# posix swidth implementation works for: linux, freebsd, darwin, openindiana, cygwin
from .posix import swidth
if sys.platform.startswith('linux'): # pragma: linux only if sys.platform.startswith('linux'): # pragma: linux only
from .linux import API_VERSION as OS_API_VERSION from .linux import API_VERSION as OS_API_VERSION
from .linux import acl_get, acl_set from .linux import acl_get, acl_set
from .linux import set_flags, get_flags from .linux import set_flags, get_flags
from .linux import SyncFile from .linux import SyncFile
from .linux import swidth
elif sys.platform.startswith('freebsd'): # pragma: freebsd only elif sys.platform.startswith('freebsd'): # pragma: freebsd only
from .freebsd import API_VERSION as OS_API_VERSION from .freebsd import API_VERSION as OS_API_VERSION
from .freebsd import acl_get, acl_set from .freebsd import acl_get, acl_set
from .freebsd import swidth
elif sys.platform == 'darwin': # pragma: darwin only elif sys.platform == 'darwin': # pragma: darwin only
from .darwin import API_VERSION as OS_API_VERSION from .darwin import API_VERSION as OS_API_VERSION
from .darwin import acl_get, acl_set from .darwin import acl_get, acl_set
from .darwin import swidth

View File

@ -2,7 +2,6 @@ import os
from ..helpers import user2uid, group2gid from ..helpers import user2uid, group2gid
from ..helpers import safe_decode, safe_encode from ..helpers import safe_decode, safe_encode
from .posix import swidth
API_VERSION = '1.1_03' API_VERSION = '1.1_03'

View File

@ -2,7 +2,6 @@ import os
from ..helpers import posix_acl_use_stored_uid_gid from ..helpers import posix_acl_use_stored_uid_gid
from ..helpers import safe_encode, safe_decode from ..helpers import safe_encode, safe_decode
from .posix import swidth
API_VERSION = '1.1_03' API_VERSION = '1.1_03'

View File

@ -8,7 +8,6 @@ from ..helpers import user2uid, group2gid
from ..helpers import safe_decode, safe_encode from ..helpers import safe_decode, safe_encode
from .base import SyncFile as BaseSyncFile from .base import SyncFile as BaseSyncFile
from .base import safe_fadvise from .base import safe_fadvise
from .posix import swidth
from libc cimport errno from libc cimport errno
from libc.stdint cimport int64_t from libc.stdint cimport int64_t