src/eric7/SystemUtilities/FileSystemUtilities.py

branch
server
changeset 10680
306373ccf8fd
parent 10603
8093b9e14b75
parent 10668
2be6fadcac40
child 10791
ca9ece290f71
--- a/src/eric7/SystemUtilities/FileSystemUtilities.py	Tue Mar 26 10:55:04 2024 +0100
+++ b/src/eric7/SystemUtilities/FileSystemUtilities.py	Wed Apr 10 17:03:56 2024 +0200
@@ -122,7 +122,7 @@
     return any(os.access(os.path.join(directory, file), os.X_OK) for directory in dirs)
 
 
-def startswithPath(path, start):
+def startsWithPath(path, start):
     """
     Function to check, if a path starts with a given start path.
 
@@ -134,8 +134,9 @@
         path
     @rtype bool
     """
+    start1 = start if start.endswith(os.sep) else f"{start}{os.sep}"
     return bool(start) and (
-        path == start or normcasepath(path).startswith(normcasepath(start + "/"))
+        path == start or normcasepath(path).startswith(normcasepath(start1))
     )
 
 

eric ide

mercurial