def UninstallDriver(bundle_name):
 km = objc.KextManager()
 cf_bundle_name = km.PyStringToCFString(bundle_name)
 status = km.iokit.KextManagerUnloadKextWithIdentifier(cf_bundle_name)
 km.dll.CFRelease(cf_bundle_name)
 return status

def UninstallDriver ( bundle_name ) : km = objc . KextManager ( ) cf_bundle_name = km . PyStringToCFString ( bundle_name ) status = km . iokit . KextManagerUnloadKextWithIdentifier ( cf_bundle_name ) km . dll . CFRelease ( cf_bundle_name ) return status
calls into the iokit to unload a kext by its name .