Skip to content

Commit 06faf91

Browse files
committed
[send_report] Not error but warn if an attachment does not exist
1 parent 02cd8e1 commit 06faf91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

send_report.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
import os, smtplib, subprocess, mimetypes, socket
3+
import os, smtplib, subprocess, mimetypes, socket, sys
44
import pandas as pd
55

66

@@ -56,7 +56,9 @@ def main():
5656

5757
# Add attachments
5858
for attachment in args.attachments:
59-
assert os.path.isfile(attachment), f'{attachment} is not a file'
59+
if not os.path.isfile(attachment):
60+
print(f'warning: {attachment} is not a file', file=sys.stderr)
61+
continue
6062
add_attachment(msg, attachment)
6163

6264
all_body_content = ''

0 commit comments

Comments
 (0)