diff options
author | Filipp Lepalaan <f@230.to> | 2013-06-09 13:57:24 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-06-09 13:57:24 +0300 |
commit | f08f9ccf505aab421a6334715ce122bf450406a2 (patch) | |
tree | 374865a76a540a2c041d69cbbb1d7075a92a17a1 | |
parent | 5c1321ac20eb7ea8ecb55ba4e7bfa1a974851dcc (diff) | |
download | py-gsxws-f08f9ccf505aab421a6334715ce122bf450406a2.tar.gz py-gsxws-f08f9ccf505aab421a6334715ce122bf450406a2.tar.bz2 py-gsxws-f08f9ccf505aab421a6334715ce122bf450406a2.zip |
Return None for invalid key
-rw-r--r-- | gsxws/xmltodict.py | 6 |
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) |