eric6/eric6config.py

changeset 8240
93b8a353c4bf
parent 7960
e8fc383322f7
--- a/eric6/eric6config.py	Wed Apr 14 19:38:19 2021 +0200
+++ b/eric6/eric6config.py	Wed Apr 14 19:59:16 2021 +0200
@@ -8,6 +8,7 @@
 """
 
 import os
+import contextlib
 
 __ericDir = os.path.dirname(__file__)
 
@@ -38,10 +39,8 @@
     @return requested config value
     @exception AttributeError raised to indicate an invalid config entry
     """
-    try:
+    with contextlib.suppress(KeyError):
         return _pkg_config[name]
-    except KeyError:
-        pass
 
     raise AttributeError(
         '"{0}" is not a valid configuration value'.format(name))

eric ide

mercurial