Browse Source

os.rename заменён на shutil.move

tags/3.4.0_beta5
Mike Khiretskiy 5 years ago
parent
commit
dad8051be9
2 changed files with 5 additions and 4 deletions
  1. +1
    -1
      pym/update/profile.py
  2. +4
    -3
      pym/update/update.py

+ 1
- 1
pym/update/profile.py View File

@@ -194,7 +194,7 @@ class ProfileRepository(object):
rpath_new = path.join(storage.directory, repo_name)
if path.exists(rpath_new):
removeDir(rpath_new)
os.rename(rpath, rpath_new)
shutil.move(rpath, rpath_new)
pr = cls(repo_name, storage)
return pr



+ 4
- 3
pym/update/update.py View File

@@ -33,6 +33,7 @@ from calculate.update.datavars import DataVarsUpdate
from calculate.update.update_info import UpdateInfo
from calculate.lib.cl_log import log
import re
import shutil
from collections import MutableSet
from update_tasks import EmergeMark

@@ -310,7 +311,7 @@ class Update(object):
self._syncRepository(repname, url, rpath_new, revision,
cb_progress=self.setProgress)
removeDir(rpath)
os.rename(rpath_new, rpath)
shutil.move(rpath_new, rpath)
except OSError as e:
raise UpdateError(_("Failed to modify the "
"{repname} repository").format(
@@ -349,7 +350,7 @@ class Update(object):
cachename) + ".stash")
if path.exists(cachedir_s):
removeDir(cachedir_s)
os.rename(cachedir, cachedir_s)
shutil.move(cachedir, cachedir_s)
except BaseException as e:
pass

@@ -378,7 +379,7 @@ class Update(object):
path.basename(cachename)+".stash")
if path.exists(cachedir_s):
try:
os.rename(cachedir_s, cachedir)
shutil.move(cachedir_s, cachedir)
except BaseException as e:
pass
else:


Loading…
Cancel
Save