MCPcopy
hub / github.com/tanelpoder/0xtools / _check_value

Method _check_value

lib/0xtools/argparse.py:2286–2291  ·  view source on GitHub ↗
(self, action, value)

Source from the content-addressed store, hash-verified

2284 return result
2285
2286 def _check_value(self, action, value):
2287 # converted value must be one of the choices (if specified)
2288 if action.choices is not None and value not in action.choices:
2289 tup = value, ', '.join(map(repr, action.choices))
2290 msg = _('invalid choice: %r (choose from %s)') % tup
2291 raise ArgumentError(action, msg)
2292
2293 # =======================
2294 # Help-formatting methods

Callers 1

_get_valuesMethod · 0.95

Calls 1

ArgumentErrorClass · 0.85

Tested by

no test coverage detected