src/eric7/SystemUtilities/FileSystemUtilities.py

branch
server
changeset 10561
be23a662d709
parent 10521
a51b382e47d7
child 10583
2114cc7275e8
--- a/src/eric7/SystemUtilities/FileSystemUtilities.py	Sat Feb 10 11:28:58 2024 +0100
+++ b/src/eric7/SystemUtilities/FileSystemUtilities.py	Sun Feb 11 18:35:44 2024 +0100
@@ -358,14 +358,18 @@
     if f1 is None or f2 is None:
         return False
 
-    if followSymlinks:
-        if normcaseabspath(os.path.realpath(f1)) == normcaseabspath(
-            os.path.realpath(f2)
-        ):
-            return True
+    if isPlainFileName(f1) and isPlainFileName(f2):
+        if followSymlinks:
+            if normcaseabspath(os.path.realpath(f1)) == normcaseabspath(
+                os.path.realpath(f2)
+            ):
+                return True
+        else:
+            if normcaseabspath(f1) == normcaseabspath(f2):
+                return True
+
     else:
-        if normcaseabspath(f1) == normcaseabspath(f2):
-            return True
+        return f1 == f2
 
     return False
 
@@ -388,14 +392,20 @@
     if f1 is None or f2 is None:
         return False
 
-    if followSymlinks:
-        if normcaseabspath(os.path.dirname(os.path.realpath(f1))) == normcaseabspath(
-            os.path.dirname(os.path.realpath(f2))
-        ):
-            return True
+    if isPlainFileName(f1) and isPlainFileName(f2):
+        if followSymlinks:
+            if normcaseabspath(
+                os.path.dirname(os.path.realpath(f1))
+            ) == normcaseabspath(os.path.dirname(os.path.realpath(f2))):
+                return True
+        else:
+            if normcaseabspath(os.path.dirname(f1)) == normcaseabspath(
+                os.path.dirname(f2)
+            ):
+                return True
+
     else:
-        if normcaseabspath(os.path.dirname(f1)) == normcaseabspath(os.path.dirname(f2)):
-            return True
+        return os.path.dirname(f1) == os.path.dirname(f2)
 
     return False
 

eric ide

mercurial