Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Review action, still some open ones
  • Loading branch information
Leonard de Ruijter
Leonard de Ruijter committed Jul 18, 2017
commit d4de85dc342985a114800cf1f8d28bf4272cdc2c
15 changes: 6 additions & 9 deletions source/NVDAObjects/IAccessible/MSHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,12 @@ def __contains__(self,item):
return self.containsCache[item]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then change this to return item in self.containsCache

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If we do this, the block below that actually runs hasAttribute never gets executed.

except LookupError:
pass
value = self[item]
if value is not None:
contains = True
self.containsCache[item]=contains
return contains
try:
contains= self.HTMLNode.hasAttribute(item)
except (COMError,NameError):
contains = False
contains=item in self.cache
if not contains:
try:
contains=self.HTMLNode.hasAttribute(item)
except (COMError,NameError):
pass
self.containsCache[item]=contains
return contains

Expand Down