A new environment variable,
PYTHONWARNINGS
, allows controlling warnings. It should be set to a string containing warning settings, equivalent to those used with the -W
switch, separated by commas. (Contributed by Brian Curtin; bpo-7301.)
For example, the following setting will print warnings every time they occur, but turn warnings from the
Cookie
module into an error. (The exact syntax for setting an environment variable varies across operating systems and shells.)
No comments:
Post a Comment