Apparently I didn’t include the parts that don’t need to be changed. (Actually, with the correct input type, this piece of code shouldn’t raise any exception period other than BaseExcept like KeyboardInterrupt, which usually shouldn’t be caught like this either. So I would omit the try...except myself.)