def replaceResourceModule(self, value):
        """
        Restore the original resource module to L{sys.modules}.
        """
        if value is None:
            try:
                del sys.modules['resource']
            except KeyError:
                pass
        else:
            sys.modules['resource'] = value

        Restore the original resource module to L{sys.modules}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_posixprocess.py