Don't try to import exception from simplejson, instead use the exceptions base class. Since this is more general exception, include less code in the try: clause.