Commit 258c53b
committed
Don't crash when trying to recover from animation failures.
Previously, if an animation-generating subprocess (e.g. ffmpeg)
failed while data was piped in, we'd get a ValueError because we'd
communicate() with the subprocess once in grab_frame(), to generate a
first error, and again at cleanup time, in the finally: clause, but that
second time, the subprocess' stdout and stderr had already been closed.
Instead, don't do anything in grab_frame() and let the finally: clause
handle the errors.
Also replace the nondescript RuntimeError by a CalledProcessError, which
is more descriptive, generates a proper error message by itself
("Command 'foo' returned non-zero exit status 42") and is more easily
introspectable (it includes stdout, stderr as attributes). Given that
we would previously sometimes throw a ValueError instead of the intended
RuntimeError, I think the API change is worth it.
Un-xfail a test.1 parent 46ba49a commit 258c53b
3 files changed
Lines changed: 32 additions & 41 deletions
File tree
- doc/api/next_api_changes
- lib/matplotlib
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
383 | 375 | | |
384 | 376 | | |
385 | 377 | | |
| |||
396 | 388 | | |
397 | 389 | | |
398 | 390 | | |
399 | | - | |
400 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
401 | 397 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 398 | + | |
| 399 | + | |
408 | 400 | | |
409 | 401 | | |
410 | 402 | | |
| |||
511 | 503 | | |
512 | 504 | | |
513 | 505 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
525 | 511 | | |
526 | 512 | | |
527 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
246 | | - | |
| 244 | + | |
247 | 245 | | |
248 | 246 | | |
249 | 247 | | |
| |||
252 | 250 | | |
253 | 251 | | |
254 | 252 | | |
255 | | - | |
| 253 | + | |
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
259 | 257 | | |
260 | | - | |
| 258 | + | |
261 | 259 | | |
262 | 260 | | |
263 | 261 | | |
0 commit comments