summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2018-10-03 23:36:59 +0200
committernico <nico@magicbroccoli.de>2018-10-03 23:36:59 +0200
commit6c6c14b55fdbf3f79e21f961354952190b443a6b (patch)
tree880e58b10bf08a623f7b559afe4c0526b5ff1c51
parent825167b8aa69ddcf3261b8a81c6e09c2d01baa71 (diff)
* switched xml.etreeElementTree for defusexml
- removed unnecessary pass statement
-rw-r--r--classes/xep.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/classes/xep.py b/classes/xep.py
index 6293c27..9e4f61f 100644
--- a/classes/xep.py
+++ b/classes/xep.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
-import xml.etree.ElementTree as ET
+import defusedxml.ElementTree as ET
class XEPRequest:
@@ -24,9 +24,8 @@ class XEPRequest:
try:
with open(".etag") as file:
local_etag = file.read()
- except FileExistsError:
+ except FileNotFoundError:
local_etag = ""
- pass
with requests.Session() as s:
s.headers.update({'Accept': 'application/xml'})