src/eric7/MicroPython/MicroPythonFileSystemUtilities.py

branch
eric7
changeset 9767
2eed840795c0
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
--- a/src/eric7/MicroPython/MicroPythonFileSystemUtilities.py	Wed Feb 15 15:55:37 2023 +0100
+++ b/src/eric7/MicroPython/MicroPythonFileSystemUtilities.py	Wed Feb 15 17:45:10 2023 +0100
@@ -115,9 +115,11 @@
     except OSError:
         return []
 
-    if dirname in ("", "/"):
+    if dirname:
+        return [
+            (f, fstat(os.path.join(dirname, f)))
+            for f in files
+            if isVisible(f, showHidden)
+        ]
+    else:
         return [(f, fstat(f)) for f in files if isVisible(f, showHidden)]
-
-    return [
-        (f, fstat(os.path.join(dirname, f))) for f in files if isVisible(f, showHidden)
-    ]

eric ide

mercurial