mirror of
https://github.com/arsenetar/send2trash.git
synced 2026-01-22 14:41:40 +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:
@@ -30,6 +30,7 @@ except ImportError:
|
||||
from urllib import quote
|
||||
|
||||
from .compat import text_type, environb
|
||||
from .util import preprocess_paths
|
||||
from .exceptions import TrashPermissionError
|
||||
|
||||
try:
|
||||
@@ -172,8 +173,7 @@ def get_dev(path):
|
||||
|
||||
|
||||
def send2trash(paths):
|
||||
if not isinstance(paths, list):
|
||||
paths = [paths]
|
||||
paths = preprocess_paths(paths)
|
||||
for path in paths:
|
||||
if isinstance(path, text_type):
|
||||
path_b = fsencode(path)
|
||||
|
||||
Reference in New Issue
Block a user