--- a/eric6/E5Network/E5SslCertificateSelectionDialog.py Sat Sep 21 15:37:43 2019 +0200 +++ b/eric6/E5Network/E5SslCertificateSelectionDialog.py Sat Sep 21 16:04:17 2019 +0200 @@ -15,8 +15,9 @@ except ImportError: pass -from .Ui_E5SslCertificateSelectionDialog import \ +from .Ui_E5SslCertificateSelectionDialog import ( Ui_E5SslCertificateSelectionDialog +) import Utilities import UI.PixmapCache @@ -100,8 +101,10 @@ """ Private slot to handle the selection of an item. """ - enable = len(self.certificatesTree.selectedItems()) > 0 and \ + enable = ( + len(self.certificatesTree.selectedItems()) > 0 and self.certificatesTree.selectedItems()[0].parent() is not None + ) self.buttonBox.button(QDialogButtonBox.OK).setEnabled(enable) self.viewButton.setEnabled(enable) @@ -111,8 +114,9 @@ Private slot to show data of the selected certificate. """ try: - from E5Network.E5SslCertificatesInfoDialog import \ + from E5Network.E5SslCertificatesInfoDialog import ( E5SslCertificatesInfoDialog + ) cert = QSslCertificate.fromData( self.certificatesTree.selectedItems()[0].data( 0, self.CertRole)) @@ -128,8 +132,10 @@ @return selected certificate @rtype QSslCertificate """ - valid = len(self.certificatesTree.selectedItems()) > 0 and \ + valid = ( + len(self.certificatesTree.selectedItems()) > 0 and self.certificatesTree.selectedItems()[0].parent() is not None + ) if valid: certificate = QSslCertificate.fromData(