mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-07 01:19:48 +00:00
Refactor comments
This commit is contained in:
parent
36212e0883
commit
a8b98ccf59
@ -376,7 +376,8 @@ class Results(Markable):
|
|||||||
try:
|
try:
|
||||||
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.
|
# 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).
|
||||||
if e.errno in (EISDIR, EACCES):
|
if e.errno in (EISDIR, EACCES):
|
||||||
p = str(outfile)
|
p = str(outfile)
|
||||||
dirname, basename = op.split(p)
|
dirname, basename = op.split(p)
|
||||||
|
@ -76,7 +76,8 @@ 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:
|
||||||
if e.errno in (EISDIR, EACCES): # it's a directory
|
# It's a directory, code is 21 on OS X / Linux (EISDIR) and 13 on Windows (EACCES)
|
||||||
|
if e.errno in (EISDIR, EACCES):
|
||||||
_smart_move_or_copy(shutil.copytree, source_path, dest_path)
|
_smart_move_or_copy(shutil.copytree, source_path, dest_path)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user