Fix and add support for Python 3.12.
Review Request #13094 — Created June 2, 2023 and submitted
This updates unit tests for pydiffx to run on Python 3.12. The legacy
TestCase.assertRaisesRegexphas been removed in 3.12, replaced by
TestCaseclass now optimistically uses the
new version, and patches the old one in on Python 2.7.
Unit tests pass on all supported versions of Python.