@@ -132,15 +132,15 @@ def filterwarnings(action, message="", category=Warning, module="", lineno=0,
132132 append = False ):
133133 """Insert an entry into the list of warnings filters (at the front).
134134
135- 'action' -- one of "error", "ignore", "always", "default", "module",
135+ 'action' -- one of "error", "ignore", "always", "all", " default", "module",
136136 or "once"
137137 'message' -- a regex that the warning message must match
138138 'category' -- a class that the warning must be a subclass of
139139 'module' -- a regex that the module name must match
140140 'lineno' -- an integer line number, 0 matches all warnings
141141 'append' -- if true, append to the list of filters
142142 """
143- if action not in {"error" , "ignore" , "always" , "default" , "module" , "once" }:
143+ if action not in {"error" , "ignore" , "always" , "all" , " default" , "module" , "once" }:
144144 raise ValueError (f"invalid action: { action !r} " )
145145 if not isinstance (message , str ):
146146 raise TypeError ("message must be a string" )
@@ -171,13 +171,13 @@ def simplefilter(action, category=Warning, lineno=0, append=False):
171171 """Insert a simple entry into the list of warnings filters (at the front).
172172
173173 A simple filter matches all modules and messages.
174- 'action' -- one of "error", "ignore", "always", "default", "module",
174+ 'action' -- one of "error", "ignore", "always", "all", " default", "module",
175175 or "once"
176176 'category' -- a class that the warning must be a subclass of
177177 'lineno' -- an integer line number, 0 matches all warnings
178178 'append' -- if true, append to the list of filters
179179 """
180- if action not in {"error" , "ignore" , "always" , "default" , "module" , "once" }:
180+ if action not in {"error" , "ignore" , "always" , "all" , " default" , "module" , "once" }:
181181 raise ValueError (f"invalid action: { action !r} " )
182182 if not isinstance (lineno , int ):
183183 raise TypeError ("lineno must be an int" )
@@ -248,8 +248,7 @@ def _setoption(arg):
248248def _getaction (action ):
249249 if not action :
250250 return "default"
251- if action == "all" : return "always" # Alias
252- for a in ('default' , 'always' , 'ignore' , 'module' , 'once' , 'error' ):
251+ for a in ('default' , 'always' , 'all' , 'ignore' , 'module' , 'once' , 'error' ):
253252 if a .startswith (action ):
254253 return a
255254 raise _OptionError ("invalid action: %r" % (action ,))
@@ -397,7 +396,7 @@ def warn_explicit(message, category, filename, lineno,
397396 if onceregistry .get (oncekey ):
398397 return
399398 onceregistry [oncekey ] = 1
400- elif action == "always" :
399+ elif action in { "always" , "all" } :
401400 pass
402401 elif action == "module" :
403402 registry [key ] = 1
@@ -690,7 +689,7 @@ def extract():
690689
691690# filters contains a sequence of filter 5-tuples
692691# The components of the 5-tuple are:
693- # - an action: error, ignore, always, default, module, or once
692+ # - an action: error, ignore, always, all, default, module, or once
694693# - a compiled regex that must match the warning message
695694# - a class representing the warning category
696695# - a compiled regex that must match the module that is being warned
0 commit comments