Skip to content

Commit

Permalink
-modified function callbacks to work with general callable objects
Browse files Browse the repository at this point in the history
  • Loading branch information
peter.rogers committed Dec 25, 2012
1 parent 2e4ace3 commit ff3ec85
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pgu/gui/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ def send(self,code,event=None):
try:
code = func.__code__
except:
code = func.func_code
try:
code = func.func_code
except:
# Nothing to inspect, so just call the object and hope for the best
func(*cb.params)
continue

nargs = code.co_argcount
names = list(code.co_varnames)[:nargs]
Expand Down

0 comments on commit ff3ec85

Please sign in to comment.