__init__.py 776 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 __future__ import unicode_literals
  6. from platform import version
  7. # if windows is vista or newer and pywin32 is available use IFileOperation
  8. if int(version().split(".", 1)[0]) >= 6:
  9. try:
  10. # Attempt to use pywin32 to use IFileOperation
  11. from send2trash.win.modern import send2trash
  12. except ImportError:
  13. # use SHFileOperation as fallback
  14. from send2trash.win.legacy import send2trash
  15. else:
  16. # use SHFileOperation as fallback
  17. from send2trash.win.legacy import send2trash # noqa: F401