File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -466,12 +466,16 @@ def __init__(
466466 default : t .Union [decimal .Decimal , None ] = decimal .Decimal (0.0 ),
467467 ** kwargs ,
468468 ) -> None :
469- if isinstance (digits , tuple ) and len (digits ) != 2 :
470- raise ValueError (
471- "The `digits` argument should be a tuple of length 2, with "
472- "the first value being the precision, and the second value "
473- "being the scale."
474- )
469+ if isinstance (digits , tuple ):
470+ if len (digits ) != 2 :
471+ raise ValueError (
472+ "The `digits` argument should be a tuple of length 2, "
473+ "with the first value being the precision, and the second "
474+ "value being the scale."
475+ )
476+ else :
477+ if digits is not None :
478+ raise ValueError ("The digits argument should be a tuple." )
475479
476480 self ._validate_default (default , (decimal .Decimal , None ))
477481
You can’t perform that action at this time.
0 commit comments