Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
aemous committed Aug 8, 2024
1 parent 8997e5a commit 87d8c13
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions awscli/customizations/paginate.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,21 +314,11 @@ def check_should_enable_pagination_call_parameters(
parsed_globals.paginate = False


# This function checks that the integral value passed to it is non-negative, and raises a
# ParamValidationError if it not. As such, it can be used as a type for pagination-related
# argparse arguments that must be non-negative integral values.
def nonnegative_int(value):
ival = int(value)
if ival < 0:
raise ValueError("invalid literal for nonnegative int() with base 10: '%s'" % value)
return ival


class PageArgument(BaseCLIArgument):
type_map = {
'string': str,
'integer': nonnegative_int,
'long': nonnegative_int,
'integer': int,
'long': int,
}

def __init__(self, name, documentation, parse_type, serialized_name):
Expand Down

0 comments on commit 87d8c13

Please sign in to comment.