Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions json5/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,9 @@ def __init__(
self.allow_duplicate_keys = allow_duplicate_keys

if not isinstance(quote_style, QuoteStyle):
raise ValueError(
'quote_style argument must be a json5.QuoteStyle value')
raise TypeError(
'quote_style argument must be a json5.QuoteStyle value'
)
self.quote_style = quote_style
self.use_duck_typing = use_duck_typing

Expand Down
4 changes: 2 additions & 2 deletions tests/lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,9 @@ def checkp(**kwargs):
c(more_double_single_first, single_more_double_single_first)

def test_invalid_quote_styles(self):
with self.assertRaises(ValueError):
with self.assertRaises(TypeError):
json5.dumps("it's", quote_style='always_double')
with self.assertRaises(ValueError):
with self.assertRaises(TypeError):
json5.dumps('foo', quote_style=1)

def test_skip_keys(self):
Expand Down