__init__.py 928 B

123456789101112131415161718192021222324
  1. # Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
  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. import sys
  6. from send2trash.exceptions import TrashPermissionError # noqa: F401
  7. if sys.version_info[0] < 3:
  8. raise RuntimeError("send2trash is only compatible with Python 3 and above (use versions <= 1.8.3 for python 2).")
  9. if sys.platform == "darwin":
  10. from send2trash.mac import send2trash
  11. elif sys.platform == "win32":
  12. from send2trash.win import send2trash
  13. else:
  14. try:
  15. # If we can use gio, let's use it
  16. from send2trash.plat_gio import send2trash
  17. except ImportError:
  18. # Oh well, let's fallback to our own Freedesktop trash implementation
  19. from send2trash.plat_other import send2trash # noqa: F401