'Restore the original resource module to L{sys.modules}.'

def replaceResourceModule(self, value):

    if (value is None):
        try:
            del sys.modules['resource']
        except KeyError:
            pass
    else:
        sys.modules['resource'] = value
