Pretty much. I guess it makes more sense to wrap it in a try/except block at the top of the code and set a global.