Simple refactor
This commit is contained in:
parent
b54008188e
commit
c3b3e69d5d
|
@ -14,7 +14,8 @@ 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)
|
||||||
if self.tree.getroot().find('error') is not None:
|
error = self.tree.find('error')
|
||||||
|
if error:
|
||||||
raise Exception('you may have entered the wrong appid')
|
raise Exception('you may have entered the wrong appid')
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user