Commit db63da7
* bpo-42644: Validate values in logging.disable() Technically make the value of manager a property that checks and convert values assigned to it properly. This has the side effect of making `logging.disable` also accept strings representing the various level of warnings. We want to validate the type of the disable attribute at assignment time, as it is later compared to other levels when emitting warnings and would generate a `TypeError: '>=' not supported between ....` in a different part of the code base, which can make it difficult to track down. When assigned an incorrect value; it will raise a TypeError when the wrong type, or ValueError if an invalid str. Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> (cherry picked from commit b32d8b4) Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
1 parent 28bf6ab commit db63da7
File tree
3 files changed
+20
-0
lines changed- Lib
- logging
- test
- Misc/NEWS.d/next/Library
3 files changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1269 | 1269 | | |
1270 | 1270 | | |
1271 | 1271 | | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1272 | 1280 | | |
1273 | 1281 | | |
1274 | 1282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4191 | 4191 | | |
4192 | 4192 | | |
4193 | 4193 | | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
4194 | 4203 | | |
4195 | 4204 | | |
4196 | 4205 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments