Skip to content

Commit

Permalink
refs #8733. Check existance before deletion.
Browse files Browse the repository at this point in the history
When we have group workspaces, if the parent group workspace is deleted first, then it will also remove the children. If that happens, the names previously fetched (which also include the childeren) may be invalid. Checking each workspace before deletion will avoid the invalid delete.
  • Loading branch information
OwenArnold committed Feb 3, 2014
1 parent 0ecab36 commit 5f5e265
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/scripts/Reflectometry/isis_reflectometry/quick.py
Expand Up @@ -344,14 +344,14 @@ def polCorr(polcorr, IvsLam, crho, calpha, cAp, cPp):
print message
return IvsLam


def cleanup():
names = mtd.getObjectNames()
for name in names:
if re.search("^_", name):
if re.search("^_", name) and mtd.doesExist(name):
print "deleting " + name
DeleteWorkspace(name)


def get_defaults(run_ws, polcorr = False):
'''
Fetch out instrument level defaults.
Expand Down

0 comments on commit 5f5e265

Please sign in to comment.