Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions source/NVDAObjects/IAccessible/ia2TextMozilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
This is now used by other applications as well.
"""

import itertools
from comtypes import COMError
import winUser
import textInfos
Expand Down Expand Up @@ -628,7 +627,7 @@ def compareEndPoints(self, other, which):
otherAncs = self._getAncestors(otherTi, otherObj)
# Find the first common ancestor.
maxAncIndex = min(len(selfAncs), len(otherAncs)) - 1
for (selfAncTi, selfAncObj), (otherAncTi, otherAncObj) in itertools.izip(selfAncs[maxAncIndex::-1], otherAncs[maxAncIndex::-1]):
for (selfAncTi, selfAncObj), (otherAncTi, otherAncObj) in zip(selfAncs[maxAncIndex::-1], otherAncs[maxAncIndex::-1]):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please split this line while at it

if selfAncObj == otherAncObj:
break
else:
Expand Down
4 changes: 2 additions & 2 deletions source/braille.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ def getFocusContextRegions(obj, oldFocusRegions=None):
# We only want the ancestors of the buffer's root NVDAObject.
if obj != api.getFocusObject():
# Search backwards through the focus ancestors to find the index of obj.
for index, ancestor in itertools.izip(range(len(ancestors) - 1, 0, -1), reversed(ancestors)):
for index, ancestor in zip(range(len(ancestors) - 1, 0, -1), reversed(ancestors)):
if obj == ancestor:
ancestorsEnd = index
break
Expand All @@ -1446,7 +1446,7 @@ def getFocusContextRegions(obj, oldFocusRegions=None):
# Also, we don't ever want to fetch ancestor 0 (the desktop).
newAncestorsStart = max(min(_cachedFocusAncestorsEnd, ancestorsEnd), 1)
# Search backwards through the old regions to find the last common region.
for index, region in itertools.izip(range(len(oldFocusRegions) - 1, -1, -1), reversed(oldFocusRegions)):
for index, region in zip(range(len(oldFocusRegions) - 1, -1, -1), reversed(oldFocusRegions)):
ancestorIndex = getattr(region, "_focusAncestorIndex", None)
if ancestorIndex is None:
continue
Expand Down
4 changes: 3 additions & 1 deletion source/languageHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def getAvailableLanguages(presentational=False):
displayNames.append("%s, %s"%(desc,entry) if desc else entry)
#Prepare a zipped view of language codes and descriptions.
# #7284: especially for sorting by description.
langs = zip(locales,displayNames)
# #7105 (Py3 review required): Python 2 list 0> Python 3 iterator.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this comment is necessary. Furthermore, it contains a typo.

# Thus wrap this inside a list call.
langs = list(zip(locales,displayNames))
if presentational:
langs.sort(key=lambda lang: lang[1])
#include a 'user default, windows' language, which just represents the default language for this user account
Expand Down