--- a/eric6/WebBrowser/VirusTotal/VirusTotalApi.py Wed Apr 21 19:40:50 2021 +0200 +++ b/eric6/WebBrowser/VirusTotal/VirusTotalApi.py Thu Apr 22 18:02:47 2021 +0200 @@ -79,10 +79,11 @@ """ Private method to load the settings. """ - if Preferences.getWebBrowser("VirusTotalSecure"): - protocol = "https" - else: - protocol = "http" + protocol = ( + "https" + if Preferences.getWebBrowser("VirusTotalSecure") else + "http" + ) self.GetFileReportUrl = self.GetFileReportPattern.format(protocol) self.ScanUrlUrl = self.ScanUrlPattern.format(protocol) self.GetUrlReportUrl = self.GetUrlReportPattern.format(protocol) @@ -109,10 +110,11 @@ @param key service key (string) @param protocol protocol used to access VirusTotal (string) """ - if protocol == "": - urlStr = self.GetFileReportUrl - else: - urlStr = self.GetFileReportPattern.format(protocol) + urlStr = ( + self.GetFileReportUrl + if protocol == "" else + self.GetFileReportPattern.format(protocol) + ) request = QNetworkRequest(QUrl(urlStr)) request.setHeader(QNetworkRequest.KnownHeaders.ContentTypeHeader, "application/x-www-form-urlencoded")