(cls)
Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
Replace distutils . dist . Distribution with this class for the duration of this context .
def patch(cls):
        """
        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        """
        orig = distutils.core.Distribution
        distutils.core.Distribution = cls
        try:
            yield
        finally:
            distutils.core.Distribution = orig
def patch ( cls ) : orig = distutils . core . Distribution distutils . core . Distribution = cls try : yield finally : distutils . core . Distribution = orig