Commit 951ed33
gh-104745: Limit starting a patcher more than once without stopping it (GH-126649)
Previously, this would cause an `AttributeError` if the patch stopped more than once after this, and would also disrupt the original patched object.
---------
(cherry picked from commit 1e40c5b)
Co-authored-by: Red4Ru <39802734+Red4Ru@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 361dda5 commit 951ed33
File tree
3 files changed
+62
-2
lines changed- Lib
- test/test_unittest/testmock
- unittest
- Misc/NEWS.d/next/Library
3 files changed
+62
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
748 | 796 | | |
749 | 797 | | |
750 | 798 | | |
| |||
1098 | 1146 | | |
1099 | 1147 | | |
1100 | 1148 | | |
1101 | | - | |
| 1149 | + | |
1102 | 1150 | | |
1103 | 1151 | | |
1104 | 1152 | | |
| |||
1111 | 1159 | | |
1112 | 1160 | | |
1113 | 1161 | | |
1114 | | - | |
| 1162 | + | |
1115 | 1163 | | |
1116 | 1164 | | |
1117 | 1165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| 1332 | + | |
1332 | 1333 | | |
1333 | 1334 | | |
1334 | 1335 | | |
| |||
1441 | 1442 | | |
1442 | 1443 | | |
1443 | 1444 | | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
1444 | 1448 | | |
1445 | 1449 | | |
1446 | 1450 | | |
| |||
1572 | 1576 | | |
1573 | 1577 | | |
1574 | 1578 | | |
| 1579 | + | |
1575 | 1580 | | |
1576 | 1581 | | |
1577 | 1582 | | |
| |||
1591 | 1596 | | |
1592 | 1597 | | |
1593 | 1598 | | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1594 | 1602 | | |
1595 | 1603 | | |
1596 | 1604 | | |
| |||
1607 | 1615 | | |
1608 | 1616 | | |
1609 | 1617 | | |
| 1618 | + | |
1610 | 1619 | | |
1611 | 1620 | | |
1612 | 1621 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments