Extract method

This commit is contained in:
Jason R. Coombs 2014-06-08 10:59:50 +01:00
parent ed0fa7c799
commit 4831ebb427

View File

@ -14,6 +14,9 @@ compat.fix_HTTPMessage()
class Result(object): class Result(object):
def __init__(self, stream): def __init__(self, stream):
self.tree = etree.parse(stream) self.tree = etree.parse(stream)
self._handle_error()
def _handle_error(self):
error = self.tree.find('error') error = self.tree.find('error')
if error: if error:
code = error.find('code').text code = error.find('code').text