Skip to content

Global commands: restore commands affected by division operator differences between Python 2 and 3 - #9748

Merged
michaelDCurran merged 2 commits into
nvaccess:threshold_py3_stagingfrom
josephsl:py3divisionOperatorGlobalCommands
Jun 15, 2019
Merged

Global commands: restore commands affected by division operator differences between Python 2 and 3#9748
michaelDCurran merged 2 commits into
nvaccess:threshold_py3_stagingfrom
josephsl:py3divisionOperatorGlobalCommands

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Link to issue number:

Another variant of #9641

Summary of the issue:

Global commands involving divisoin operators are broken in Python 3: move mouse to navigator object and battery status.

Description of how this pull request fixes the issue:

Changed one slash to two slashes for affected commands.

Testing performed:

Compiled a Python 3 version of NVDA and ran affected commands before and after division operator change.

Known issues with pull request:

None

Change log entry:

None

Additional context:

There are division operator issues in other files that cannot be patched until UI Access privilege is restored, the most prominent one being touch tracking (may or may not be an integer when calculating touch gesture tracking).

josephsl added 2 commits June 15, 2019 10:35
…ee integers for mouse coordinates. Re nvaccess#9641.

Move mouse to navigator object command fails in Python 3 because of ytpe differences: user32::SetCursorPos wants integers, but because one slash is used, it'll get floats, causing errors to be logged. Thus guarantee inteers via floor division, thus restoring the said command.
…nvaccess#9641.

With just one slash, hours nad minutes for remaining time on battery will get floats when the text format specifies integers. Thus use floor division, restoring battery status command in Python 3.
@josephsl
josephsl requested a review from michaelDCurran June 15, 2019 17:57
@michaelDCurran
michaelDCurran merged commit e8fdfbf into nvaccess:threshold_py3_staging Jun 15, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jun 15, 2019
@josephsl
josephsl deleted the py3divisionOperatorGlobalCommands branch July 19, 2020 22:13
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