鏡像自
https://github.com/arsenetar/send2trash.git
synced 2025-07-02 21:43:22 +00:00
比較提交
沒有共同的提交。「0a48c26f689f4bd9dfd4e6345523319c27d437a3」和「e59ddcae988aa4fb1e7f1fefc571831f28627f2c」的歷史完全不同。
0a48c26f68
...
e59ddcae98
@ -18,8 +18,3 @@ else:
|
|||||||
text_type = unicode # noqa: F821
|
text_type = unicode # noqa: F821
|
||||||
binary_type = str
|
binary_type = str
|
||||||
environb = os.environ
|
environb = os.environ
|
||||||
|
|
||||||
try:
|
|
||||||
from collections.abc import Iterable as iterable_type
|
|
||||||
except ImportError:
|
|
||||||
from collections import Iterable as iterable_type
|
|
||||||
|
@ -5,13 +5,9 @@
|
|||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
|
||||||
from send2trash.compat import text_type, binary_type, iterable_type
|
|
||||||
|
|
||||||
|
|
||||||
def preprocess_paths(paths):
|
def preprocess_paths(paths):
|
||||||
if isinstance(paths, iterable_type) and not isinstance(paths, (text_type, binary_type)):
|
if not isinstance(paths, list):
|
||||||
paths = list(paths)
|
|
||||||
elif not isinstance(paths, list):
|
|
||||||
paths = [paths]
|
paths = [paths]
|
||||||
# Convert items such as pathlib paths to strings
|
# Convert items such as pathlib paths to strings
|
||||||
paths = [path.__fspath__() if hasattr(path, "__fspath__") else path for path in paths]
|
paths = [path.__fspath__() if hasattr(path, "__fspath__") else path for path in paths]
|
||||||
|
載入中…
x
新增問題並參考
Block a user