shutil.SameFileError exception is not available on centos, using private function from shutil which does the same with condition

This commit is contained in:
iLLiCiTiT 2020-11-04 11:07:20 +01:00
parent 62b6ac19b6
commit ff8698bfcb

View file

@ -615,12 +615,12 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
# copy file with speedcopy and check if size of files are simetrical
while True:
import shutil
try:
if not shutil._samefile(src, dst):
copyfile(src, dst)
except shutil.SameFileError:
self.log.critical("files are the same {} to {}".format(src,
dst))
else:
self.log.critical(
"files are the same {} to {}".format(src, dst)
)
os.remove(dst)
try:
shutil.copyfile(src, dst)