mirror of
https://github.com/mightyBroccoli/xmpp-chatbot.git
synced 2024-12-04 22:33:36 +01:00
* switched xml.etreeElementTree for defusexml
- removed unnecessary pass statement
This commit is contained in:
parent
825167b8aa
commit
6c6c14b55f
1 changed files with 2 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import requests
|
import requests
|
||||||
import xml.etree.ElementTree as ET
|
import defusedxml.ElementTree as ET
|
||||||
|
|
||||||
|
|
||||||
class XEPRequest:
|
class XEPRequest:
|
||||||
|
@ -24,9 +24,8 @@ class XEPRequest:
|
||||||
try:
|
try:
|
||||||
with open(".etag") as file:
|
with open(".etag") as file:
|
||||||
local_etag = file.read()
|
local_etag = file.read()
|
||||||
except FileExistsError:
|
except FileNotFoundError:
|
||||||
local_etag = ""
|
local_etag = ""
|
||||||
pass
|
|
||||||
|
|
||||||
with requests.Session() as s:
|
with requests.Session() as s:
|
||||||
s.headers.update({'Accept': 'application/xml'})
|
s.headers.update({'Accept': 'application/xml'})
|
||||||
|
|
Loading…
Reference in a new issue