Commit 4325802
authored
Handle ValueError in scope resets (#4928)
### Description
when async generators throw a `GeneratorExit` we end up with
```
ValueError: <Token var=<ContextVar name='current_scope' default=None at 0x7f04cf05fb50> at 0x7f04ceb17340> was created in a different Context
```
so just catch that and rely on GC to cleanup the contextvar since we
can't be smarter than that anyway for this case.
#### Issues
* resolves: #4925
* resolves: PY-18861 parent 23411e5 commit 4325802
2 files changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
| 1682 | + | |
1683 | 1683 | | |
1684 | 1684 | | |
1685 | 1685 | | |
| |||
1717 | 1717 | | |
1718 | 1718 | | |
1719 | 1719 | | |
1720 | | - | |
| 1720 | + | |
1721 | 1721 | | |
1722 | 1722 | | |
1723 | 1723 | | |
| |||
1761 | 1761 | | |
1762 | 1762 | | |
1763 | 1763 | | |
1764 | | - | |
| 1764 | + | |
1765 | 1765 | | |
1766 | 1766 | | |
1767 | 1767 | | |
1768 | 1768 | | |
1769 | | - | |
| 1769 | + | |
1770 | 1770 | | |
1771 | 1771 | | |
1772 | 1772 | | |
| |||
1808 | 1808 | | |
1809 | 1809 | | |
1810 | 1810 | | |
1811 | | - | |
| 1811 | + | |
1812 | 1812 | | |
1813 | 1813 | | |
1814 | 1814 | | |
1815 | 1815 | | |
1816 | | - | |
| 1816 | + | |
1817 | 1817 | | |
1818 | 1818 | | |
1819 | 1819 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
| 911 | + | |
911 | 912 | | |
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
915 | 916 | | |
916 | 917 | | |
917 | 918 | | |
918 | | - | |
| 919 | + | |
919 | 920 | | |
920 | 921 | | |
921 | | - | |
| 922 | + | |
922 | 923 | | |
923 | 924 | | |
924 | 925 | | |
| |||
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
935 | | - | |
| 936 | + | |
936 | 937 | | |
937 | 938 | | |
938 | 939 | | |
939 | 940 | | |
940 | 941 | | |
941 | 942 | | |
| 943 | + | |
942 | 944 | | |
943 | 945 | | |
944 | 946 | | |
945 | 947 | | |
946 | 948 | | |
947 | 949 | | |
948 | 950 | | |
949 | | - | |
| 951 | + | |
950 | 952 | | |
951 | 953 | | |
952 | 954 | | |
953 | 955 | | |
954 | 956 | | |
955 | | - | |
| 957 | + | |
956 | 958 | | |
957 | 959 | | |
958 | 960 | | |
| |||
965 | 967 | | |
966 | 968 | | |
967 | 969 | | |
968 | | - | |
| 970 | + | |
969 | 971 | | |
970 | 972 | | |
971 | 973 | | |
0 commit comments