Commit 17e28ea
Add a wrapper around itertools.tee to make it a thread-safe
When writing to multiple output formats, users ran into problems. A runtime exception was raised: `generator raised StopIteration`. This is caused by itertools.tee not being thread safe: https://docs.python.org/3/library/itertools.html#itertools.tee
PiperOrigin-RevId: 6647087271 parent cd0fa0c commit 17e28ea
1 file changed
+35
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
193 | 226 | | |
194 | 227 | | |
195 | 228 | | |
| |||
207 | 240 | | |
208 | 241 | | |
209 | 242 | | |
210 | | - | |
| 243 | + | |
211 | 244 | | |
212 | 245 | | |
213 | 246 | | |
| |||
0 commit comments