1 2 3 4 5
- if not os.path.exists(target_path): - os.makedirs(target_path) + if not os.path.exists(target_path) or not os.listdir(target_path): + if not os.path.exists(target_path): + os.makedirs(target_path)