[Sync] ALS Typograf stability impovements

This commit is contained in:
Roman Timashev committed 2017-10-16 13:04:05 +03:00
1 parent 7793830e60
commit fc43f89099
1 file changed
+4 -2
+4 -2
View File
@@ -27,10 +27,12 @@ async def typograf(text, options={}):
'Content-Type': 'text/xml',
'SOAPAction': 'http://typograf.artlebedev.ru/webservices/ProcessText',
})
response_tree = etree.fromstring(resp.encode())
resp_text = resp.encode()
try:
# create xml tree from response
response_tree = etree.fromstring(resp_text)
# look for ProcessTextResult
typograf_response = response_tree.getchildren()[0].getchildren()[0].getchildren()[0].text
except Exception as response_tree: