diff options
Diffstat (limited to 'Lib/mimetypes.py')
-rw-r--r-- | Lib/mimetypes.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 9a88680..3d68694 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -245,7 +245,7 @@ class MimeTypes: while True: try: ctype = _winreg.EnumKey(mimedb, i) - except EnvironmentError: + except OSError: break else: if '\0' not in ctype: @@ -259,13 +259,13 @@ class MimeTypes: # Only check file extensions if not subkeyname.startswith("."): continue - # raises EnvironmentError if no 'Content Type' value + # raises OSError if no 'Content Type' value mimetype, datatype = _winreg.QueryValueEx( subkey, 'Content Type') if datatype != _winreg.REG_SZ: continue self.add_type(mimetype, subkeyname, strict) - except EnvironmentError: + except OSError: continue def guess_type(url, strict=True): |