Skip to content

Commit

Permalink
Merge pull request #114 from KleeTaurus/master
Browse files Browse the repository at this point in the history
Fix xml parse issue for download_bill API
  • Loading branch information
messense committed Dec 14, 2015
2 parents d30dd4d + 247a6b5 commit 1ed77ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wechatpy/pay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import requests
import xmltodict
from xml.parsers.expat import ExpatError
from optionaldict import optionaldict

from wechatpy.utils import random_string
Expand Down Expand Up @@ -122,7 +123,7 @@ def _handle_result(self, res):
xml = res.text
try:
data = xmltodict.parse(xml)['xml']
except xmltodict.ParsingInterrupted:
except (xmltodict.ParsingInterrupted, ExpatError):
# 解析 XML 失败
return xml

Expand Down

0 comments on commit 1ed77ce

Please sign in to comment.