Skip to content

Windows Console Handler: use floor division assignment operator when calculating coordinates - #9737

Merged
michaelDCurran merged 1 commit into
nvaccess:threshold_py3_stagingfrom
josephsl:py3divisionOperatorWinConsole
Jun 13, 2019
Merged

Windows Console Handler: use floor division assignment operator when calculating coordinates#9737
michaelDCurran merged 1 commit into
nvaccess:threshold_py3_stagingfrom
josephsl:py3divisionOperatorWinConsole

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Link to issue number:

Another fix for #9641

Summary of the issue:

In Windows Console handler, coordinate calculation returns float instead of integer, and backspace doesn't work.

Description of how this pull request fixes the issue:

Changed classic division assignment (/=) to floor division assignment (//=) to guarantee integers.

Steps:

  1. Grep -r "/=" source
  2. Change /= to //= based on context.

Testing performed:

Tested with a binary build of this PR and ensured that console handling was working (tested with Command Prompt and WSL/Ubuntu).

Known issues with pull request:

None

Change log entry:

None

nvaccess#9641.

When calculating console coordinates, Python 2 returns integers but Python 3 returns a float, caused by division assignment operator. Thus use //= instead of /= to guarantee integers. This also resolves backspacing error seen with wrong coordinate type.
@josephsl
josephsl requested a review from michaelDCurran June 13, 2019 20:36
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