sktime / skbase

Base classes for creating scikit-learn-like parametric objects, and tools for working with them.
BSD 3-Clause "New" or "Revised" License
17 stars 11 forks source link

[BUG] fix permanently muted `stdout` after `all_objects` call #328

Closed fkiraly closed 4 months ago

fkiraly commented 4 months ago

This fixes https://github.com/sktime/skbase/issues/327, which caused a permanently muted stdout after all_objects call.

The bug was due to the sys.stdout not being properly reset after muting, in one of two instances where this was done.

This PR also replaces both instances with a muter context manager - the implementation of the muting was a bit brittle, relying on manual try/except and temp stdout handling which is risky.

Includes a test that the sys.stdout is indeed unchanged.