This commit is contained in:
Michael Davidsaver
2013-03-31 14:15:47 -04:00
parent 955fea0106
commit 8ce086f567
2 changed files with 6 additions and 1 deletions

View File

@ -122,7 +122,7 @@ static int allow_ioscan(pyDevice *priv)
static void release_ioscan(pyDevice *priv)
{
if(priv->scanobj && PyObject_HasAttrString(priv->scanobj, "release")) {
if(priv->scanobj && PyCallable_Check(priv->scanobj)) {
PyObject *ret = PyObject_CallFunction(priv->scanobj, "O", priv->pyrecord);
if(ret)
Py_DECREF(ret);

View File

@ -11,6 +11,11 @@ class DeviceSupport(Interface):
def allowScan(record):
"""Return True to allow SCAN='I/O Intr'
or False to prevent this.
If a callable object is returned then if
will be invoked when I/O Intr scanning
is disabled. A Record instance is passed
as the first (and only) argument.
"""
def process(record, reason):