File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1191,4 +1191,5 @@ def test_overwrite_out_of_order_table_key():
11911191
11921192
11931193def test_set_default_int ():
1194- TOMLDocument ().setdefault (4 , 5 )
1194+ with pytest .raises (TypeError ):
1195+ TOMLDocument ().setdefault (4 , 5 )
Original file line number Diff line number Diff line change @@ -375,14 +375,13 @@ class SingleKey(Key):
375375
376376 def __init__ (
377377 self ,
378- k : str | int ,
378+ k : str ,
379379 t : KeyType | None = None ,
380380 sep : str | None = None ,
381381 original : str | None = None ,
382382 ) -> None :
383- # keys are allowed to be ints but should be interpreted as strings
384383 if not isinstance (k , str ):
385- k = str ( k )
384+ raise TypeError ( "Keys must be strings" )
386385
387386 if t is None :
388387 if not k or any (
You can’t perform that action at this time.
0 commit comments