Update list-folders.py

Fix rare occuring issue