Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __connect(self):
"""Ensures that we are connected to the XML-RPC server."""
try:
if self.__connection == None or not self.__token:
self.__connection = xmlrpclib.ServerProxy(
"http://api.opensubtitles.org/xml-rpc", transport = Xml_rpc_proxy(), allow_none = True )
self.__token = self.__call("LogIn", "", "", "en", "pysd 0.1")["token"]
except Exception as e:
raise Fatal_error("Unable to connect to {0} XML-RPC server: {1}.", self.__domain_name, e)