1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2026-07-02 02:57:53 +00:00
Files
send2trash/send2trash/win/__init__.py
Yaofei Zheng ad0f2af984 python2 removal: more clean up (#107)
1. remove from __future__ as those feature is mandatory >= 3.0 and we are in the future
2. python3 script defaults to UTF-8
2026-01-27 00:57:55 -06:00

20 lines
736 B
Python

# Copyright 2017 Virgil Dupras
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from platform import version
# if windows is vista or newer and pywin32 is available use IFileOperation
if int(version().split(".", 1)[0]) >= 6:
try:
# Attempt to use pywin32 to use IFileOperation
from send2trash.win.modern import send2trash
except ImportError:
# use SHFileOperation as fallback
from send2trash.win.legacy import send2trash
else:
# use SHFileOperation as fallback
from send2trash.win.legacy import send2trash # noqa: F401