]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Anthony Baxter's patch to expose the parser's `strict' flag in these
authorBarry Warsaw <barry@python.org>
Thu, 18 Jul 2002 21:29:17 +0000 (21:29 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 18 Jul 2002 21:29:17 +0000 (21:29 +0000)
convenience functions.  Closes SF # 583188 (python project).

Lib/email/__init__.py

index a82ef5776d8281e400a47e55560cfce91b22f200..1693c78a094a233fa9f3335b53a5f3a60d94b53e 100644 (file)
@@ -4,7 +4,7 @@
 """A package for parsing, handling, and generating email messages.
 """
 
-__version__ = '2.1'
+__version__ = '2.2'
 
 __all__ = ['Charset',
            'Encoders',
@@ -32,8 +32,8 @@ __all__ = ['Charset',
 from email.Parser import Parser as _Parser
 from email.Message import Message as _Message
 
-def message_from_string(s, _class=_Message):
-    return _Parser(_class).parsestr(s)
+def message_from_string(s, _class=_Message, strict=1):
+    return _Parser(_class, strict=strict).parsestr(s)
 
-def message_from_file(fp, _class=_Message):
-    return _Parser(_class).parse(fp)
+def message_from_file(fp, _class=_Message, strict=1):
+    return _Parser(_class, strict=strict).parse(fp)