Commit 39193be
committed
Avoid KeyErrors in os._Environ.get() and __contains__()
Implement get() and __contains__() on os._Environ directly, which cuts out the
cost of raising and catching a KeyError when the keys do not exist.1 parent 45e5b1b commit 39193be
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
723 | 728 | | |
724 | 729 | | |
725 | 730 | | |
| |||
728 | 733 | | |
729 | 734 | | |
730 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
731 | 739 | | |
732 | 740 | | |
733 | 741 | | |
| |||
770 | 778 | | |
771 | 779 | | |
772 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
773 | 785 | | |
774 | 786 | | |
775 | 787 | | |
| |||
0 commit comments