Skip to content

Commit

Permalink
删除没有用到的lxml
Browse files Browse the repository at this point in the history
  • Loading branch information
gusibi committed Nov 23, 2018
1 parent a75e69f commit 2d328fe
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Requires
* requests
* simplejson
* six
* lxml
* xmltodict
* pycrypto
```
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ simplejson
requests
chardet
six
lxml
xmltodict
pycrypto
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
requirements = [l for l in f.read().splitlines() if l]

setup(name="python-weixin",
version="0.4.3",
version="0.4.4",
description="Python Weixin API client support wechat-app",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
11 changes: 0 additions & 11 deletions weixin/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,3 @@ def error_parser(error_html, encoding='gbk'):
error_parser.feed(html)
if error_parser.data:
return error_dict.get(error_parser.data[0], None)


def validate_xml(xml):
"""
使用lxml.etree.parse 检测xml是否符合语法规范
"""
from lxml import etree
try:
return etree.parse(xml)
except etree.XMLSyntaxError:
return False
2 changes: 2 additions & 0 deletions weixin/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def exchange_refresh_token_for_access_token(self, refresh_token):
return req.exchange_for_access_token(refresh_token=refresh_token)

def exchange_code_for_session_key(self, code):
if not code:
raise OAuth2AuthExchangeError("Invalid code")
req = OAuth2AuthExchangeRequest(self)
return req.exchange_for_session_key(js_code=code)

Expand Down

0 comments on commit 2d328fe

Please sign in to comment.