1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 17:06:17 +00:00

fix SyntaxWarnings

This commit is contained in:
Louis-Philippe Véronneau 2020-01-05 22:21:29 -05:00
parent 37b1602461
commit 61edff6122
No known key found for this signature in database
GPG Key ID: 7AEAC4EC6AAA0A97

View File

@ -59,7 +59,7 @@ class JSONBaseFormatter(BaseFormatter):
if (elem is None) != (data is None): if (elem is None) != (data is None):
raise ValueError("Expecting both elem and data or neither of them") raise ValueError("Expecting both elem and data or neither of them")
rv = {"status": "failed" if elem is "error" else "ok", "version": API_VERSION} rv = {"status": "failed" if elem == "error" else "ok", "version": API_VERSION}
if data: if data:
rv[elem] = self.__remove_empty_lists(data) rv[elem] = self.__remove_empty_lists(data)
@ -135,7 +135,7 @@ class XMLFormatter(BaseFormatter):
raise ValueError("Expecting both elem and data or neither of them") raise ValueError("Expecting both elem and data or neither of them")
response = { response = {
"status": "failed" if elem is "error" else "ok", "status": "failed" if elem == "error" else "ok",
"version": API_VERSION, "version": API_VERSION,
"xmlns": "http://subsonic.org/restapi", "xmlns": "http://subsonic.org/restapi",
} }