def import_c_accel(globs, cname):
    """
    Import the C-accelerator for the __name__
    and copy its globals.
    """
    name = globs.get('__name__')
    if not name or name == cname:
        return
    from gevent._compat import PURE_PYTHON
    if PURE_PYTHON:
        return
    import importlib
    import warnings
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', ImportWarning)
        mod = importlib.import_module(cname)
    globs.clear()
    globs.update(mod.__dict__)
    if 'import_c_accel' in globs:
        del globs['import_c_accel']
