Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Is the C extension installed?

.. versionadded:: 1.5

        def has_c():
    """Is the C extension installed?

    .. versionadded:: 1.5
    """
    try:
        from pymongo import _cmessage
        return True
    except ImportError:
        return False
        


src/p/y/pymongo-2.7/tools/fail_if_no_c.py   pymongo(Download)
import pymongo
 
if not pymongo.has_c() or not bson.has_c():
    sys.exit("could not load C extensions")
 

src/m/o/mongo-python-driver-HEAD/tools/fail_if_no_c.py   mongo-python-driver(Download)
import pymongo
 
if not pymongo.has_c() or not bson.has_c():
    sys.exit("could not load C extensions")
 

src/c/b/cbtool-HEAD/lib/stores/mongodb_datastore_adapter.py   cbtool(Download)
        self.pid = "TEST_" + getpwuid(os.getuid())[0]
        self.mongodb_conn = False
        if pymongo.has_c() is False:
            msg = "WARNING: You do not have the pymongo C extensions installed. Data retrieval performance will be slow"
            cberr(msg)