From: Fred Drake Date: Tue, 19 May 1998 15:15:59 +0000 (+0000) Subject: guess_extension(): Revise documentation string to be more clear. If not X-Git-Tag: v1.5.2a1~597 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49413418582f1e2c94fc77275833cd83ea8bd6c9;p=python guess_extension(): Revise documentation string to be more clear. If not inited, call init(). --- diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 6bc55ea46d..cb28afe2b6 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -71,10 +71,13 @@ def guess_extension(type): Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been - associated with any particular data stream, but has been known to be - used for streams of the MIME type given by `type'. If `type' is not - known, None is returned. + associated with any particular data stream, but would be mapped to the + MIME type `type' by guess_type(). If no extension can be guessed for + `type', None is returned. """ + global inited + if not inited: + init() type = string.lower(type) for ext, stype in types_map.items(): if type == stype: