Skip to content

Commit

Permalink
Merge pull request #982 from greschd/fix_981_use_shutil_move
Browse files Browse the repository at this point in the history
Fix 981.
  • Loading branch information
sphuber authored Dec 11, 2017
2 parents e141cf2 + b0131b1 commit f7f55ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aiida/work/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import os.path as path
import portalocker
import portalocker.utils
from shutil import copyfile
import shutil
import tempfile
import pickle
from plum.persistence.bundle import Bundle
Expand Down Expand Up @@ -189,7 +189,7 @@ def load_all_processes(self):
LOGGER.warning("moving '{}' to failed directory".format(f))
try:
filename = os.path.basename(f)
os.rename(f, os.path.join(self.failed_directory, filename))
shutil.move(f, os.path.join(self.failed_directory, filename))
except OSError:
pass

Expand Down Expand Up @@ -362,7 +362,7 @@ def _release_process(self, pid, save_dir=None):
if save_dir is not None:
self._ensure_directory(save_dir)
to = path.join(save_dir, self.pickle_filename(pid))
copyfile(pickle_path, to)
shutil.copyfile(pickle_path, to)
os.remove(pickle_path)
else:
raise ValueError(
Expand Down

0 comments on commit f7f55ce

Please sign in to comment.