summaryrefslogtreecommitdiff
path: root/Doc/includes/email-headers.py
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/includes/email-headers.py')
-rw-r--r--Doc/includes/email-headers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/includes/email-headers.py b/Doc/includes/email-headers.py
index a53317dbd8..89c8f3af32 100644
--- a/Doc/includes/email-headers.py
+++ b/Doc/includes/email-headers.py
@@ -1,8 +1,9 @@
# Import the email modules we'll need
from email.parser import Parser
-# If the e-mail headers are in a file, uncomment this line:
-#headers = Parser().parse(open(messagefile, 'r'))
+# If the e-mail headers are in a file, uncomment these two lines:
+# with open(messagefile) as fp:
+# headers = Parser().parse(fp)
# Or for parsing headers in a string, use:
headers = Parser().parsestr('From: <user@example.com>\n'