Skip to content

Commit eff9faf

Browse files
committed
revert(bar): drop finalizer-chain workarounds, keep develop __del__ semantics
Two attempts to satisfy CodeQL's py/missing-call-to-delete approximation added finalizer complexity with zero behavioral gain: ProgressBarBase defines no __del__ of its own and runtime attribute lookup reaches ProgressBarMixinBase.__del__ unconditionally; CodeQL's static super() model simply cannot follow the MRO past the Iterable hop. Restore the exact develop semantics (teardown-fragile code should stay simple) and dismiss the alert as a false positive instead.
1 parent b950458 commit eff9faf

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

‎progressbar/bar.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,6 @@ def __repr__(self):
207207
label = f': {self.label}' if self.label else ''
208208
return f'<{self.__class__.__name__}#{self.index}{label}>'
209209

210-
def __del__(self) -> None:
211-
# ProgressBarBase mixes collections.abc.Iterable in alongside
212-
# ProgressBarMixinBase (which defines the real finalizer). Define
213-
# __del__ here so that finalizer is reached explicitly through the MRO
214-
# instead of only by attribute inheritance — behaviourally identical
215-
# (super() resolves to the same ProgressBarMixinBase.__del__), but it
216-
# makes the multiple-inheritance finalizer chain unambiguous.
217-
super().__del__() # pragma: no cover
218-
219-
220210
class DefaultFdMixin(ProgressBarMixinBase):
221211
# The file descriptor to write to. Defaults to `sys.stderr`
222212
fd: base.TextIO = sys.stderr

0 commit comments

Comments
 (0)