MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _getaction

Function _getaction

tools/python-3.11.9-amd64/Lib/warnings.py:242–249  ·  view source on GitHub ↗
(action)

Source from the content-addressed store, hash-verified

240
241# Helper for _setoption()
242def _getaction(action):
243 if not action:
244 return "default"
245 if action == "all": return "always" # Alias
246 for a in ('default', 'always', 'ignore', 'module', 'once', 'error'):
247 if a.startswith(action):
248 return a
249 raise _OptionError("invalid action: %r" % (action,))
250
251# Helper for _setoption()
252def _getcategory(category):

Callers 1

_setoptionFunction · 0.85

Calls 2

_OptionErrorClass · 0.85
startswithMethod · 0.80

Tested by

no test coverage detected