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

        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        
product/gradle-plugin/src/main/python/setuptools/build_meta.py