bring exceptions in line with modern python