Skip to content

Commit

Permalink
don't let log cleanup errors prevent engine start
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Sep 27, 2012
1 parent 1981689 commit 5cdc6db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions IPython/parallel/apps/baseapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ def reinit_logging(self):
log_dir = self.profile_dir.log_dir
if self.clean_logs:
for f in os.listdir(log_dir):
if re.match(r'%s-\d+\.(log|err|out)'%self.name,f):
os.remove(os.path.join(log_dir, f))
if re.match(r'%s-\d+\.(log|err|out)' % self.name, f):
try:
os.remove(os.path.join(log_dir, f))
except (OSError, IOError):
# probably just conflict from sibling process
# already removing it
pass
if self.log_to_file:
# Start logging to the new log file
log_filename = self.name + u'-' + str(os.getpid()) + u'.log'
Expand Down

0 comments on commit 5cdc6db

Please sign in to comment.