Fixes SyntaxWarnings from Python 3.8#9225
Fixes SyntaxWarnings from Python 3.8#9225bsipocz merged 1 commit intoastropy:masterfrom MSeifert04:fix-some-python-3.8-warnings
Conversation
The two comparisons usings "is" trigger the warning and because these are strings they can be replaced by "==". The one test in wcsaxes looks like a real bug where the missing "," was interpreted as function call on a tuple.
| return [('freq', 0, 'value'), | ||
| ('time', 0, 'mjd'), | ||
| ('celestial', 0, 'spherical.lon.degree') | ||
| ('celestial', 0, 'spherical.lon.degree'), |
There was a problem hiding this comment.
Wait a minute... how did this not fail CI (before this fix)?
There was a problem hiding this comment.
Because the property is never called?! 😅
There was a problem hiding this comment.
@astrofrog , looks like adding a test to cover this is in order?
There was a problem hiding this comment.
I'm not sure if this really needs a test since it's just a test-class that needs to satisfy the abstract properties of BaseLowLevelWCS that might not be even relevant for the test.
That's why I just fixed the SyntaxWarning.
There was a problem hiding this comment.
Given that the PR is merged now, should we open an issue for this issue?
|
I changed the milestone to 3.2.2 since these appear to be bugfixes. |
| self._represent_as_dict_attrs += ('mask',) | ||
|
|
||
| elif method is 'null_value': | ||
| elif method == 'null_value': |
There was a problem hiding this comment.
Nice catch. Coincidentally, also caught by @taldcroft in a PR by me: #8998 (comment)
|
Thank you @MSeifert04! |
Fixes SyntaxWarnings from Python 3.8
The two comparisons usings "is" trigger the warning and because these are strings they can be replaced by "==".
The one test in wcsaxes looks like a real bug where the missing "," was interpreted as function call on a tuple.
Not sure about the milestone.