mirror of
https://github.com/arsenetar/send2trash.git
synced 2026-04-05 11:41:39 +00:00
Add ability to handle pathlib paths
- Handle pathlib paths across all implementations, plat_other already did - Move preprocessing code to common location
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
from __future__ import unicode_literals
|
||||
import os.path as op
|
||||
from .compat import text_type
|
||||
from .util import preprocess_paths
|
||||
|
||||
from ctypes import (
|
||||
windll,
|
||||
Structure,
|
||||
@@ -101,8 +103,7 @@ def get_short_path_name(long_name):
|
||||
|
||||
|
||||
def send2trash(paths):
|
||||
if not isinstance(paths, list):
|
||||
paths = [paths]
|
||||
paths = preprocess_paths(paths)
|
||||
# convert data type
|
||||
paths = [
|
||||
text_type(path, "mbcs") if not isinstance(path, text_type) else path
|
||||
|
||||
Reference in New Issue
Block a user