aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-06-09 13:57:24 +0300
committerFilipp Lepalaan <f@230.to>2013-06-09 13:57:24 +0300
commitf08f9ccf505aab421a6334715ce122bf450406a2 (patch)
tree374865a76a540a2c041d69cbbb1d7075a92a17a1 /gsxws
parent5c1321ac20eb7ea8ecb55ba4e7bfa1a974851dcc (diff)
downloadpy-gsxws-f08f9ccf505aab421a6334715ce122bf450406a2.tar.gz
py-gsxws-f08f9ccf505aab421a6334715ce122bf450406a2.tar.bz2
py-gsxws-f08f9ccf505aab421a6334715ce122bf450406a2.zip
Return None for invalid key
Diffstat (limited to 'gsxws')
-rw-r--r--gsxws/xmltodict.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gsxws/xmltodict.py b/gsxws/xmltodict.py
index 25e0c6e..430df3e 100644
--- a/gsxws/xmltodict.py
+++ b/gsxws/xmltodict.py
@@ -17,7 +17,11 @@ class XmlDictObject(dict):
dict.__init__(self, initdict)
def __getattr__(self, item):
- v = self.__getitem__(item)
+
+ try:
+ v = self.__getitem__(item)
+ except KeyError:
+ return
if item in ["packingList", "proformaFileData", "returnLabelFileData"]:
v = base64.b64decode(v)