Commit 32c7640
authored
Invert default value logic for BusABC._is_shutdown. (#1774)
The destructor of BusABC gives a warning when shutdown() was not
previously called on the object after construction. However, if the
construction fails (e.g. when the derived bus class constructor raises
an exception), there is no way to call shutdown() on the unfinished
object, and it is not necessary either.
Initialize the _is_shutdown flag to False initially and flip it to
True only when the parent class constructor runs, which usually
happens last in derived classes. That avoids the shutdown warning for
objects that failed to initialize at all.1 parent ed98a0f commit 32c7640
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
0 commit comments