python-sgp4 icon indicating copy to clipboard operation
python-sgp4 copied to clipboard

Code not working in Python 3.12

Open mattiaverga opened this issue 2 years ago • 0 comments

https://github.com/brandon-rhodes/python-sgp4/blob/fac882aed0e8e5eb2cbd17409e00c7feb7c577ea/sgp4/tests.py#L37-L38

This code is not working anymore in python 3.12: it seems that the default value is evaluated before the attribute is returned: AttributeError: 'TestCase' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?

I have quickly patched with assertRaisesRegex = getattr(_testcase, 'assertRaisesRegex', None) or _testcase.assertRaisesRegexp but perhaps there's a better way.

mattiaverga avatar Jul 09 '23 17:07 mattiaverga