Fixed this by adding the following line: **if len(dirs)==0: dirs=['']**
Fixed this by adding the following line:
if len(dirs)==0: dirs=['']