[orca] Return an empty list rather than None if _getXMLRoles() fails
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Return an empty list rather than None if _getXMLRoles() fails
- Date: Mon, 15 Oct 2018 13:21:00 +0000 (UTC)
commit 7684b839faeca65987e10092c7e51fe2ea329a51
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Oct 15 15:20:14 2018 +0200
Return an empty list rather than None if _getXMLRoles() fails
src/orca/scripts/web/script_utilities.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 4266f5a91..48768009f 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -542,13 +542,13 @@ class Utilities(script_utilities.Utilities):
def _getXMLRoles(self, obj):
rv = self._xmlRoles.get(hash(obj))
- if rv is not None:
+ if rv:
return rv
try:
attrs = dict([attr.split(':', 1) for attr in obj.getAttributes()])
except:
- return None
+ return []
rv = attrs.get('xml-roles', '').split()
self._xmlRoles[hash(obj)] = rv
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]