Skip to content

Commit fd01475

Browse files
fixes a crash in build.bat when the 'dist' folder did not exist
- The error was: Traceback (most recent call last): File setup.py, line 61, in <module> create_windows_exe() File setup.py, line 13, in create_windows_exe [os.remove(x) for x in get_file_paths('dist')] File setup.py, line 10, in get_file_paths file_paths = [f for f in listdir(folder_name) if isfile(join(folder_name, f))] FileNotFoundError: [WinError 3] The system cannot find the path specified: 'dist' - The error occured only on first checkout; once the dist folder was built this error did not occur.
1 parent f667768 commit fd01475

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ def create_windows_exe():
77

88
# Get theme files and store them in a list
99
def get_file_paths(folder_name):
10-
file_paths = [f for f in listdir(folder_name) if isfile(join(folder_name, f))]
11-
return ['{}/{}'.format(folder_name, i) for i in file_paths]
10+
if os.path.isdir(folder_name):
11+
file_paths = [f for f in listdir(folder_name) if isfile(join(folder_name, f))]
12+
return ['{}/{}'.format(folder_name, i) for i in file_paths]
13+
else:
14+
return []
1215

1316
[os.remove(x) for x in get_file_paths('dist')]
1417
theme_file_paths = get_file_paths("Themes")

0 commit comments

Comments
 (0)