"UnboundLocalError: local variable 'ret' referenced before assignment"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

"UnboundLocalError: local variable 'ret' referenced before assignment"

Shawn Y.
In vsm/utils.py, pass_lock(), I assume the indent of "return ret" is off.

It could cause an unassigned variable error, if the target "run" file cannot be locked.

A possible fix:

             if lock.run():
                 ret = func(*args, **kwargs)
-            return ret
+                return ret


Thanks,