Skip to content

Improve variable naming and remove exception handling when setting language in core.main#12837

Merged
seanbudd merged 1 commit intonvaccess:masterfrom
lukaszgo1:coreSetLangImproveStyle
Sep 13, 2021
Merged

Improve variable naming and remove exception handling when setting language in core.main#12837
seanbudd merged 1 commit intonvaccess:masterfrom
lukaszgo1:coreSetLangImproveStyle

Conversation

@lukaszgo1
Copy link
Copy Markdown
Contributor

@lukaszgo1 lukaszgo1 commented Sep 13, 2021

Link to issue number:

Follow up from #12753

Summary of the issue:

During debugging for PR #12753 some issues in code around setting language in core.main become evident. In particular:

  • wx.Locale object was called locale effectively shadowing built-in Python module. While normally there is no reason to have locale imported in that scope if it is necessary for debugging the name is rather unfortunate.
  • except around importing languageHandler and setting language was too broad hiding eventual issues.

Description of how this pull request fixes the issue:

  • locale was renamed to wxLocaleObj.
  • We're no longer catching any exceptions when importing languageHandler and setting language - if any of these fails NVDA is non functional and the exception should propagate.

Testing strategy:

Ensured that NVDA still starts. Existing unit tests making sure that languageHandler is importable and that the process of setting language does not raise any exceptions.

Known issues with pull request:

None known

Change log entries:

None needed.

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • API is compatible with existing addons.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

@lukaszgo1 lukaszgo1 requested a review from a team as a code owner September 13, 2021 08:43
@lukaszgo1 lukaszgo1 requested a review from seanbudd September 13, 2021 08:43
@seanbudd seanbudd changed the title Improve style and variable naming when setting language in core.main Improve variable naming and remove exception handling when setting language in core.main Sep 13, 2021
@seanbudd seanbudd merged commit f93d911 into nvaccess:master Sep 13, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Sep 13, 2021
@lukaszgo1 lukaszgo1 deleted the coreSetLangImproveStyle branch September 13, 2021 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants