Dec-20-2018, 09:43 PM
This is why you declare which exceptions you are trying to catch explicitly, so that other exceptions can propagate as normal:
try: names=sorted(listdir(path)) except NotADirectoryError: names=[]
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures