-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cyclic import context help #11958
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from failing Linter checks and some cosmetic changes which I've requested below this looks fine to me and resolves this issue on my side. Nice work!
I don't think these imports should be considered redundant. The For more (and better) descriptions of this see: |
This comment has been minimized.
This comment has been minimized.
One unused, should refer to full import path. Another missing import.
Link to issue number:
#11950
Summary of the issue:
When installing add-ons which imported gui in their InstallTasks module NVDA failed to restart properly.
This was caused by the fact that when gui was imported it also imported contextHelp.ContextHelpMixin and contextHelp in turn also imports gui causing circular import.
Description of how this pull request fixes the issue:
Alternative fix to #11951
Breaks the circular import in contextHelp by making imports of gui, ui, and queueHandler dynamic imports.
This exposes another problem, the order of imports mattered. Several modules imported by gui, depended on ContextHelpMixin (imported name) in the gui module. This is fixed by referring directly to gui.contextHelp.ContextHelpMixin rather than gui.ContextHelpMixin in all those files. To prevent this from happening again (or being used by add-ons) it has been imported as _ContextHelpMixin.
Testing performed:
Tested as per #11950
Known issues with pull request:
Dependencies and layout of code in gui package needs attention. This would be an API breaking change, as such it can happen in 2021.1
Change log entry:
None