src/eric7/WebBrowser/CookieJar/CookieExceptionsModel.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
--- a/src/eric7/WebBrowser/CookieJar/CookieExceptionsModel.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/WebBrowser/CookieJar/CookieExceptionsModel.py	Mon Nov 07 17:19:58 2022 +0100
@@ -47,14 +47,9 @@
         if role == Qt.ItemDataRole.SizeHintRole:
             fm = QFontMetrics(QFont())
             height = fm.height() + fm.height() // 3
-            try:
-                width = fm.horizontalAdvance(
-                    self.headerData(section, orientation, Qt.ItemDataRole.DisplayRole)
-                )
-            except AttributeError:
-                width = fm.width(
-                    self.headerData(section, orientation, Qt.ItemDataRole.DisplayRole)
-                )
+            width = fm.horizontalAdvance(
+                self.headerData(section, orientation, Qt.ItemDataRole.DisplayRole)
+            )
             return QSize(width, height)
 
         if (
@@ -194,11 +189,11 @@
         @param rule type of rule to add (CookieJar.Allow, CookieJar.Block or
             CookieJar.AllowForSession)
         """
+        from .CookieJar import CookieJar
+
         if not host:
             return
 
-        from .CookieJar import CookieJar
-
         if rule == CookieJar.Allow:
             self.__addHost(
                 host,

eric ide

mercurial