eric6/Utilities/__init__.py

changeset 8260
2161475d9639
parent 8258
82b608e352ec
child 8273
698ae46f40a4
child 8306
2bfd53096b5f
--- a/eric6/Utilities/__init__.py	Wed Apr 21 19:40:50 2021 +0200
+++ b/eric6/Utilities/__init__.py	Thu Apr 22 18:02:47 2021 +0200
@@ -1613,10 +1613,11 @@
         found (string or None)
     """
     pattern = "^{0}[ \t]*=".format(key)
-    if isWindowsPlatform():
-        filterRe = re.compile(pattern, re.IGNORECASE)
-    else:
-        filterRe = re.compile(pattern)
+    filterRe = (
+        re.compile(pattern, re.IGNORECASE)
+        if isWindowsPlatform() else
+        re.compile(pattern)
+    )
     
     entries = [e for e in QProcess.systemEnvironment()
                if filterRe.search(e) is not None]
@@ -1638,10 +1639,11 @@
     @rtype bool
     """
     pattern = "^{0}[ \t]*=".format(key)
-    if isWindowsPlatform():
-        filterRe = re.compile(pattern, re.IGNORECASE)
-    else:
-        filterRe = re.compile(pattern)
+    filterRe = (
+        re.compile(pattern, re.IGNORECASE)
+        if isWindowsPlatform() else
+        re.compile(pattern)
+    )
     
     entries = [e for e in QProcess.systemEnvironment()
                if filterRe.search(e) is not None]

eric ide

mercurial