__init__.py 816 B

1234567891011121314151617181920
  1. # Copyright 2017 Virgil Dupras
  2. # This software is licensed under the "BSD" License as described in the "LICENSE" file,
  3. # which should be included with this package. The terms are also available at
  4. # http://www.hardcoded.net/licenses/bsd_license
  5. from platform import mac_ver
  6. from sys import version_info
  7. # NOTE: version of pyobjc only supports python >= 3.6 and 10.9+
  8. macos_ver = tuple(int(part) for part in mac_ver()[0].split("."))
  9. if version_info >= (3, 6) and macos_ver >= (10, 9):
  10. try:
  11. from send2trash.mac.modern import send2trash
  12. except ImportError:
  13. # Try to fall back to ctypes version, although likely problematic still
  14. from send2trash.mac.legacy import send2trash
  15. else:
  16. # Just use the old version otherwise
  17. from send2trash.mac.legacy import send2trash # noqa: F401