You always remove your debug prints? "2>/dev/null" is the new #define NDEBUG! Seriously, it bugs me a bit when someone posts blatantly broken code prefaced by a bunch of monk-placating boilerplate. It shows that the OP has learned the wrong things from reading the site.
That removes way too much. If they were things I though I might need again I'd use print whatever_I_need if DEBUG;. Redirecting STDERR will hide not just expected debug prints but also unexpected warnings.
Jenda Enoch was right!
Enjoy the last years of Rome.