Skip to content

Python 3: Fix several local overrides of range function - #9912

Merged
feerrenrut merged 1 commit into
nvaccess:threshold_py3_stagingfrom
BabbageCom:fixFromUIARange
Jul 12, 2019
Merged

Python 3: Fix several local overrides of range function#9912
feerrenrut merged 1 commit into
nvaccess:threshold_py3_stagingfrom
BabbageCom:fixFromUIARange

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Jul 11, 2019

Copy link
Copy Markdown
Collaborator

Link to issue number:

None

Summary of the issue:

In several cases in our code base, we are using range as a name of a local attribute or function parameter. In at least one case (uia _getBoundingRectsFromUIARange, this fails, as we are also calling the range function in that method.

Description of how this pull request fixes the issue:

Look for every instance of range as a local attribute. In most cases, rename it to textRange.

I started with the following regex computed by @feerrenrut: (,\W?|\W)range\W?[,)=]
I also used \Wrange[.]\w to dig up some missed cases that weren't pick up by the first regex.

Testing performed:

Tested that NVDA still starts and works as epxected. It is undoable to test every change, therefore careful review should be performed, possibly with the assistance of a linter.

Known issues with pull request:

None

Change log entry:

None

@LeonarddeR
LeonarddeR requested a review from feerrenrut July 11, 2019 05:08

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LeonarddeR

@feerrenrut
feerrenrut merged commit 92458e9 into nvaccess:threshold_py3_staging Jul 12, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jul 12, 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