Skip to content

PR: Make warning usage consistant and refine messages#398

Merged
dalthviz merged 1 commit intospyder-ide:masterfrom
CAM-Gerlach:refine-warning-hierarchy
Jan 17, 2023
Merged

PR: Make warning usage consistant and refine messages#398
dalthviz merged 1 commit intospyder-ide:masterfrom
CAM-Gerlach:refine-warning-hierarchy

Conversation

@CAM-Gerlach
Copy link
Copy Markdown
Member

Currently, as noted in issue #395 , a generic RuntimeWarning is emitted when falling back to a non-selected binding, instead of QtPy's own PythonQtWarning subclass. Furthermore, the text could perhaps be clarified a bit. I also noticed a few other issues when making this changed, which I fixed.

Therefore, this PR:

  • Emits a PythonQtWarning instead of a generic RuntimeWarning when falling back to an unselected binding, consistent with the other warnings and errors that use QtPy-specific subclasses
  • Has PythonQtWarning inherit from RuntimeWarning instead of a generic Warning , to be consistent with all the other errors and warnings and with what RuntimeWarning is meant for, and ensure the previous replacement is fully backwards compatible
  • Tweaks the message text of the former warning to be clearer and more grammatically correct
  • Fixes the outdated and incorrect docstrings of PythonQtWarning and PythonQtError
  • Updates both warning usages to modern code formatting, f-strings and to use !r instead of hardcoded quotes

@CAM-Gerlach
Copy link
Copy Markdown
Member Author

(Oops, fell asleep before I went back and hit the ready for review button)

Copy link
Copy Markdown
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small suggestions for you @CAM-Gerlach, otherwise looks good to me.

Copy link
Copy Markdown
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks @CAM-Gerlach!

Copy link
Copy Markdown
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CAM-Gerlach !

@dalthviz dalthviz merged commit aa3fe4b into spyder-ide:master Jan 17, 2023
@dalthviz
Copy link
Copy Markdown
Member

Also @CAM-Gerlach should this close #395 ?

@CAM-Gerlach
Copy link
Copy Markdown
Member Author

It may help with it some, but it isn't clear that it would resolve the actual issue the user experienced, since from the very limited information provided it is not at all clear what that actually is. I suggest we wait at least a couple weeks to see if they respond. Also, you mentioned documenting the error/warning hierarchy somewhere, which is a good idea to do at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants