diff options
author | Fred Drake <fdrake@acm.org> | 1998-05-19 15:15:59 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-05-19 15:15:59 (GMT) |
commit | 49413418582f1e2c94fc77275833cd83ea8bd6c9 (patch) | |
tree | bff0fb32d834206df05eb468e786d1ca4d0f6bf5 /Lib | |
parent | 5f4fb913a2418df5da78675b552400013605f91d (diff) | |
download | cpython-49413418582f1e2c94fc77275833cd83ea8bd6c9.zip cpython-49413418582f1e2c94fc77275833cd83ea8bd6c9.tar.gz cpython-49413418582f1e2c94fc77275833cd83ea8bd6c9.tar.bz2 |
guess_extension(): Revise documentation string to be more clear. If not
inited, call init().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/mimetypes.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 6bc55ea..cb28afe 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: |