Right function "enum_types" in "mimetypes.py"
def enum_types(mimedb):
i = 0
while True:
try:
ctype = _winreg.EnumKey(mimedb, i)
except EnvironmentError:
break
try:
ctype = ctype.encode(default_encoding) # omit in 3.x!
except UnicodeError:
pass
else:
yield ctype
i += 1
Comments
blog comments powered by Disqus