python-distilled
python-distilled copied to clipboard
7.21 Page 194 -- typographical error in register_decoder function
Original version -- attempting to access mimetype attribute of string object:
def register_decoder(cls):
for mt in cls.mimetypes:
_registry[mt.mimetype] = cls
return cls
Fixed version:
def register_decoder(cls):
for mt in cls.mimetypes:
_registry[mt] = cls
return cls