mirror of
https://github.com/arsenetar/send2trash.git
synced 2024-11-01 22:35:57 +00:00
Andrew Senetar
2e9fa38f56
- Fix some flake8 formatting errors - Auto-format files edited - Also ignore some flake8 errors when they are intented - Update .gitignore to ingore local env
21 lines
761 B
Python
21 lines
761 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 __future__ import unicode_literals
|
|
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 .plat_win_modern import send2trash
|
|
except ImportError:
|
|
# use SHFileOperation as fallback
|
|
from .plat_win_legacy import send2trash
|
|
else:
|
|
# use SHFileOperation as fallback
|
|
from .plat_win_legacy import send2trash # noqa: F401
|