mt.ctx

Monkey-patching contextlib.

For python 3.6 or earlier, this module corresponds to package contextlib2. Otherwise, it corresponds to package contextlib.

Instead of:

import contextlib

or

import contextlib2

depending on which Python version you are using, you do:

from mt import ctx

It will import the right contextlib package.

Please see Python packages contextlib for more details.