Skip to content

Commit

Permalink
Fixes for unavailable formats
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed Jan 28, 2016
1 parent caadafb commit ff190e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serialize/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _get_format(fmt):
return FORMATS[fmt]

if fmt in UNAVAILABLE_FORMATS:
raise ValueError(("'%s' is an unavailable format. " % fmt) + UNAVAILABLE_FORMATS[fmt])
raise ValueError(("'%s' is an unavailable format. " % fmt) + UNAVAILABLE_FORMATS[fmt].msg)

raise ValueError("'%s' is an unknown format. Valid options are %s" % (fmt, ', '.join(FORMATS.keys())))

Expand Down Expand Up @@ -281,7 +281,7 @@ def register_unavailable(fmt, msg='', pkg='', extension=MISSING):
if extension is MISSING:
extension = fmt

FORMATS[fmt] = UnavailableFormat(extension, msg)
UNAVAILABLE_FORMATS[fmt] = UnavailableFormat(extension, msg)

if extension:
FORMAT_BY_EXTENSION[extension.lower()] = fmt
Expand Down

0 comments on commit ff190e5

Please sign in to comment.