import importlib
import imp


def reload_module(module):
    """Backport of importlib.reload of Python 3.3+."""
    try:
        if not hasattr(importlib, 'reload'):  # python <=3.3
            raise ImportError
    except ImportError:
        return imp.reload(module)
    else:
        return importlib.reload(module)