Skip to content

Remove usage of cmp function#9758

Merged
michaelDCurran merged 1 commit intothreshold_py3_stagingfrom
py3_noCmp
Jun 16, 2019
Merged

Remove usage of cmp function#9758
michaelDCurran merged 1 commit intothreshold_py3_stagingfrom
py3_noCmp

Conversation

@michaelDCurran
Copy link
Copy Markdown
Member

Link to issue number:

None.

Summary of the issue:

the cmp function no longer exists in Python3.

Description of how this pull request fixes the issue:

Replace all usage of cmp with the recommended equivilant from the Python 3.0 what's new document: I.e.

(a>b)-(a<b)

This works as the bools returned from the comparison operators are coerced to ints (0 for False and 1 for True) when performing the subtraction.

Testing performed:

NVDA no longer comaplsins about cmp being missing when using compoundDocuments (E.g. in Gecko editable documents).
NVDA no longer fails to show the installation dialog after pressing the Install button in the NVDA launcher.

Known issues with pull request:

None.

Change log entry:

None.

Section: New features, Changes, Bug fixes

@michaelDCurran michaelDCurran requested a review from josephsl June 16, 2019 23:20
@michaelDCurran michaelDCurran merged commit eb2d280 into threshold_py3_staging Jun 16, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jun 16, 2019
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