Skip to content

Commit 6c01226

Browse files
committed
Changed return to sys.exit in python script to show error
1 parent fce491e commit 6c01226

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/scripts/icomoon_build.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
import sys
23
from selenium.common.exceptions import TimeoutException
34

45
# pycharm complains that build_assets is an unresolved ref
@@ -11,8 +12,7 @@ def main():
1112
args = arg_getters.get_selenium_runner_args()
1213
new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path)
1314
if len(new_icons) == 0:
14-
print("No files need to be uploaded. Ending script...")
15-
return
15+
sys.exit("No files need to be uploaded. Ending script...")
1616

1717
# print list of new icons
1818
print("List of new icons:", *new_icons, sep = "\n")
@@ -32,10 +32,11 @@ def main():
3232
filehandler.rename_extracted_files(args.download_path)
3333
print("Task completed.")
3434
except TimeoutException as e:
35-
print(e)
36-
print(e.stacktrace)
35+
sys.exit("Selenium Time Out Error: \n" + e)
36+
except Exception as e:
37+
sys.exit(e)
3738
finally:
38-
runner.close()
39+
runner.close()
3940

4041

4142
if __name__ == "__main__":

.github/scripts/icomoon_peek.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def main():
3838
runner.upload_svgs(svgs, screenshot_folder)
3939
print("Task completed.")
4040
except TimeoutException as e:
41-
print("Selenium Time Out Error: ", e.stacktrace, sep='\n')
41+
sys.exit("Selenium Time Out Error: \n" + e)
4242
except Exception as e:
43-
print(e)
43+
sys.exit(e)
4444
finally:
45-
runner.close()
45+
runner.close()
4646

4747

4848
def find_object_added_in_this_pr(icons: List[dict], pr_title: str):

0 commit comments

Comments
 (0)