From e0a9dad5933f5df61b96769fa56b17fa18adc256 Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Wed, 16 Nov 2011 17:59:43 +0000 Subject: [PATCH] 5291: JPG is not imported svn: r18458 --- src/gen/mime/_winmime.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gen/mime/_winmime.py b/src/gen/mime/_winmime.py index 43daed64d..ef717513d 100644 --- a/src/gen/mime/_winmime.py +++ b/src/gen/mime/_winmime.py @@ -47,9 +47,12 @@ def get_description(mime_type): progid = _get_prog_id(extension) if progid: - hcr = ConnectRegistry(None, HKEY_CLASSES_ROOT) - desc = QueryValue(hcr, progid) - CloseKey(hcr) + try: + hcr = ConnectRegistry(None, HKEY_CLASSES_ROOT) + desc = QueryValue(hcr, progid) + CloseKey(hcr) + except WindowsError: + pass if not desc: desc = _("unknown")