1
0
ミラー元 https://github.com/arsenetar/dupeguru.git 前回の同期 2025-07-12 01:33:20 +00:00

コミットを比較

..

1 コミット

作成者 SHA1 メッセージ 日付
Stanislav
820daf4682
Merge cd70c99c67a681581337f8a5e8912a286d296978 into 85a455752586ddec223bcce4f282656ea1f60e4f 2024-02-19 09:23:23 -06:00
2個のファイルの変更6行の追加6行の削除

ファイルの表示

@ -10,7 +10,6 @@ import logging
import re import re
import os import os
import os.path as op import os.path as op
from errno import EISDIR, EACCES
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
from hscommon.jobprogress.job import nulljob from hscommon.jobprogress.job import nulljob
@ -377,8 +376,8 @@ class Results(Markable):
do_write(outfile) do_write(outfile)
except OSError as e: except OSError as e:
# If our OSError is because dest is already a directory, we want to handle that. 21 is # If our OSError is because dest is already a directory, we want to handle that. 21 is
# the code we get on OS X and Linux (EISDIR), 13 is what we get on Windows (EACCES). # the code we get on OS X and Linux, 13 is what we get on Windows.
if e.errno in (EISDIR, EACCES): if e.errno in {21, 13}:
p = str(outfile) p = str(outfile)
dirname, basename = op.split(p) dirname, basename = op.split(p)
otherfiles = os.listdir(dirname) otherfiles = os.listdir(dirname)

ファイルの表示

@ -14,7 +14,6 @@ import re
import os import os
import shutil import shutil
from errno import EISDIR, EACCES
from pathlib import Path from pathlib import Path
from typing import Callable, List from typing import Callable, List
@ -76,8 +75,10 @@ def smart_copy(source_path: Path, dest_path: Path) -> None:
try: try:
_smart_move_or_copy(shutil.copy, source_path, dest_path) _smart_move_or_copy(shutil.copy, source_path, dest_path)
except OSError as e: except OSError as e:
# It's a directory, code is 21 on OS X / Linux (EISDIR) and 13 on Windows (EACCES) if e.errno in {
if e.errno in (EISDIR, EACCES): 21,
13,
}: # it's a directory, code is 21 on OS X / Linux and 13 on Windows
_smart_move_or_copy(shutil.copytree, source_path, dest_path) _smart_move_or_copy(shutil.copytree, source_path, dest_path)
else: else:
raise raise