]> git.mxchange.org Git - fba.git/blobdiff - fba/federation/lemmy.py
Fixed some issues found by pylint:
[fba.git] / fba / federation / lemmy.py
index cc6d132fa8b5fe026ebdabb0691578330f93d478..7e3c513257dfd0cb97a29d0ebd09d080fce4a97c 100644 (file)
@@ -21,10 +21,10 @@ from fba import network
 
 def fetch_peers(domain: str) -> list:
     # DEBUG: print(f"DEBUG: domain({len(domain)})={domain},software='lemmy' - CALLED!")
-    if type(domain) != str:
+    if not isinstance(domain, str):
         raise ValueError(f"Parameter domain[]={type(domain)} is not 'str'")
     elif domain == "":
-        raise ValueError(f"Parameter 'domain' is empty")
+        raise ValueError("Parameter 'domain' is empty")
 
     peers = list()
     try:
@@ -47,8 +47,8 @@ def fetch_peers(domain: str) -> list:
             print("WARNING: JSON response does not contain 'federated_instances':", domain)
             instances.update_last_error(domain, response)
 
-    except BaseException as e:
-        print(f"WARNING: Exception during fetching JSON: domain='{domain}',exception[{type(e)}]:'{str(e)}'")
+    except BaseException as exception:
+        print(f"WARNING: Exception during fetching JSON: domain='{domain}',exception[{type(exception)}]:'{str(exception)}'")
 
     # DEBUG: print(f"DEBUG: Adding '{len(peers)}' for domain='{domain}'")
     instances.set("total_peers", domain, len(peers))