Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 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,8 @@ 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]):
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
3 changes: 2 additions & 1 deletion source/languageHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ 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)
# Python 3: zip function changed from returning a list to an iterator, 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