mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
always use defusedxml.ElementTree, never xml.etree.ElementTree
defusedxml is now available and installed everywhere, including the buildserver VM and the buildserver host. This fixes bandit's error because it didn't understand the try: block * https://gitlab.com/eighthave/fdroidserver/-/jobs/3965835264 * https://bandit.readthedocs.io/en/1.7.5/blacklists/blacklist_calls.html#b313-b320-xml
This commit is contained in:
parent
4295d254f9
commit
e903952029
1 changed files with 1 additions and 5 deletions
|
|
@ -51,11 +51,7 @@ import tempfile
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
# TODO change to only import defusedxml once its installed everywhere
|
import defusedxml.ElementTree as XMLElementTree
|
||||||
try:
|
|
||||||
import defusedxml.ElementTree as XMLElementTree
|
|
||||||
except ImportError:
|
|
||||||
import xml.etree.ElementTree as XMLElementTree # nosec this is a fallback only
|
|
||||||
|
|
||||||
from base64 import urlsafe_b64encode
|
from base64 import urlsafe_b64encode
|
||||||
from binascii import hexlify
|
from binascii import hexlify
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue