I have a function from another library that occasionally prints to both stdout and stderr. I cannot hack the source code of that function. While [the example](https://stackoverflow.com/questions/36986929/redirect-print-command-in-python-script-through-tqdm-write) shows how to redirect sys.stdout inside a tqdm loop, how do I redirect stderr _at the same time_?