Move NullHandler into compat.py