Commit 530a92c
committed
[Python] Revisit try-except blocks in the ROOT facade
There are some `except Exceptions` in the ROOT facade, which are not
much better than bare `except` because they catch any meaningful error
and turn it into an uninformative "Failed to pythonize the namespace
Foo" exception, which makes it harder to develop these namespace
pythonizations and is also not helpful to the user.
The only exception that we expect is an `ImportError` if a given ROOT
component is not available, in which case we should `pass` on the
Pythonization.
All try-except blocks are revisited accordingly:
1. Remove `try-except` for the VecOps pythonization, because it is
available unconditionally, as VecOps is in TMath
2. RDF/DistRDF was already correct, I just added a comment to explain
3. RooFit: this is the case where we had the catch-all, which is
corrected
4. TMVA: for some reason, the pythonization was conditional on RDF
(probably a copy-paste error or a remnant from when the
RBatchGenerator lived in TMVA). This is fixed and a meaningfly
try-catch block implemented.
5. UHI: Just like VecOps, this module is unconditionally included and
therefore needs to `try-except`.1 parent 0046874 commit 530a92c
1 file changed
Lines changed: 29 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
| 330 | + | |
332 | 331 | | |
333 | | - | |
334 | | - | |
335 | | - | |
| 332 | + | |
336 | 333 | | |
337 | 334 | | |
338 | 335 | | |
| |||
403 | 400 | | |
404 | 401 | | |
405 | 402 | | |
| 403 | + | |
406 | 404 | | |
407 | 405 | | |
408 | 406 | | |
| |||
422 | 420 | | |
423 | 421 | | |
424 | 422 | | |
| 423 | + | |
425 | 424 | | |
426 | 425 | | |
427 | 426 | | |
428 | 427 | | |
429 | 428 | | |
430 | | - | |
431 | | - | |
432 | 429 | | |
433 | 430 | | |
434 | | - | |
435 | | - | |
436 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | 445 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
| |||
498 | 499 | | |
499 | 500 | | |
500 | 501 | | |
501 | | - | |
502 | | - | |
| 502 | + | |
503 | 503 | | |
504 | | - | |
505 | | - | |
506 | | - | |
| 504 | + | |
507 | 505 | | |
508 | 506 | | |
509 | 507 | | |
| |||
0 commit comments