Browse Source

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

develop 3.4.0_beta5
Mike Khiretskiy 7 years ago
parent
commit
dad8051be9
  1. 2
      pym/update/profile.py
  2. 7
      pym/update/update.py

2
pym/update/profile.py

@ -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

7
pym/update/update.py

@ -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