in reply to Reliably checking that something doesn't exist

Use Debugging 101 stuff: add some print statements in there that record each step of the loop, and the values of each variable during each iteration of that loop. Check the output to be sure your assumptions are being satisfied. Your code looks fine, so the problem is probably outside of what you've shown us. This means you're assuming something else is working when it probably isn't.
  • Comment on Re: Reliably checking that something doesn't exist