Adjust error line parsing for newer Python versions