Commit 49413418 authored by Fred Drake's avatar Fred Drake

guess_extension(): Revise documentation string to be more clear. If not

	inited, call init().
parent 5f4fb913
...@@ -71,10 +71,13 @@ def guess_extension(type): ...@@ -71,10 +71,13 @@ def guess_extension(type):
Return value is a string giving a filename extension, including the Return value is a string giving a filename extension, including the
leading dot ('.'). The extension is not guaranteed to have been leading dot ('.'). The extension is not guaranteed to have been
associated with any particular data stream, but has been known to be associated with any particular data stream, but would be mapped to the
used for streams of the MIME type given by `type'. If `type' is not MIME type `type' by guess_type(). If no extension can be guessed for
known, None is returned. `type', None is returned.
""" """
global inited
if not inited:
init()
type = string.lower(type) type = string.lower(type)
for ext, stype in types_map.items(): for ext, stype in types_map.items():
if type == stype: if type == stype:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment