Fix Python NameError in assertLexError