From c258d1bb580874a58e4b9cf14e36517084ae380f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 8 Mar 2012 14:51:24 -0500 Subject: [PATCH] Move function_name extraction up in pycomedi/_error.pyx's comedi_get. This avoids: pycomedi/_error.pyx:43:29: local variable 'function_name' referenced before assignment --- pycomedi/_error.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pycomedi/_error.pyx b/pycomedi/_error.pyx index 8a49add..6a2245c 100644 --- a/pycomedi/_error.pyx +++ b/pycomedi/_error.pyx @@ -50,14 +50,14 @@ def _comedi_getter(name, is_invalid): # Hmm, cannot get function by name, or pass differing function pointers... #def comedi_get(function_name, *args, **kwargs): def comedi_get(function, *args, **kwargs): + #fn = getattr(_comedilib_h, function_name) + fn = function # workaround until I get getattr() working + function_name = function.__name__ if 'error_msg' in kwargs: error_msg = kwargs.pop('error_msg') else: error_msg = 'error while running %s with %s and %s' % ( function_name, args, kwargs) - #fn = getattr(_comedilib_h, function_name) - fn = function # workaround until I get getattr() working - function_name = function.__name__ _LOG.debug('calling %s with %s %s' % (function_name, args, kwargs)) -- 2.26.2