I don't understand the try/except/print/raise pattern you've used here.  Just let the exception fly, or change the print to raise an exception with the information you want in it.