]> git.mxchange.org Git - fba.git/blobdiff - fba/federation/peertube.py
Fixed some issues found by pylint:
[fba.git] / fba / federation / peertube.py
index 13adea4b25bca2e493709275271b2e184267acc0..4c9c782fb2f7f2f27073403249ab1f965aad99a4 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='peertube' - 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")
 
     # DEBUG: print(f"DEBUG: domain='{domain}' is a PeerTube, fetching JSON ...")
     peers = list()
@@ -56,8 +56,8 @@ def fetch_peers(domain: str) -> list:
                     # Continue with next row
                     start = start + 100
 
-            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))