# HG changeset patch # User Paul Boddie # Date 1486255504 -3600 # Node ID f27977fdc0b331e2d75fe171adc206ec89221e72 # Parent 663a13dec63ef15906de31c0649ec523b63f78aa Raise TypeError when inappropriate arguments are given. diff -r 663a13dec63e -r f27977fdc0b3 templates/progops.c --- a/templates/progops.c Sun Feb 05 00:58:55 2017 +0100 +++ b/templates/progops.c Sun Feb 05 01:45:04 2017 +0100 @@ -199,9 +199,10 @@ unsigned int pos, kwpos; /* Check the number of arguments. */ + /* NOTE: Should use a more specific exception. */ if ((min > (nargs + nkwargs)) || ((nargs + nkwargs) > max)) - return __NULL; + __raise_type_error(); /* Copy the arguments. */ @@ -224,9 +225,10 @@ /* Check the table entry against the supplied argument details. Set the argument but only if it does not overwrite positional arguments. */ + /* NOTE: Should use a more specific exception. */ if ((pos == -1) || (pos < nargs)) - return __NULL; + __raise_type_error(); /* Set the argument using the appropriate position. */