diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-02 03:35:12 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-02 03:35:12 (GMT) |
commit | ad58b7c9da1f12499d7d926b084135e997ea96ad (patch) | |
tree | 638bee8e468e452c5820d1bacf0742a72736bc14 /Lib | |
parent | 3bac8b20b5284e613c5b7f6add3db3ba7c93760a (diff) | |
download | cpython-ad58b7c9da1f12499d7d926b084135e997ea96ad.zip cpython-ad58b7c9da1f12499d7d926b084135e997ea96ad.tar.gz cpython-ad58b7c9da1f12499d7d926b084135e997ea96ad.tar.bz2 |
fix a silly problem of caching gone wrong #5401
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/mimetypes.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index fc0108b..6212e78 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -237,7 +237,8 @@ def guess_type(url, strict=True): Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ - init() + if not inited: + init() return guess_type(url, strict) @@ -254,7 +255,8 @@ def guess_all_extensions(type, strict=True): Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ - init() + if not inited: + init() return guess_all_extensions(type, strict) def guess_extension(type, strict=True): @@ -269,7 +271,8 @@ def guess_extension(type, strict=True): Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ - init() + if not inited: + init() return guess_extension(type, strict) def add_type(type, ext, strict=True): @@ -284,7 +287,8 @@ def add_type(type, ext, strict=True): list of standard types, else to the list of non-standard types. """ - init() + if not inited: + init() return add_type(type, ext, strict) |