toomuchcookies / pgu

Automatically exported from code.google.com/p/pgu
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Please support "partial" functions as callback handlers #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run "partial-callback.py" (attached)

What is the expected output? What do you see instead?
That a dialog box is opened with a title and message of "Title" and "Message" 
(respectively).  Instead this crashes with:

"""
AttributeError: 'functools.partial' object has no attribute 'func_code'
"""

A functools.partial object is callable so it would be nice to be able to use 
them directly as a signal handler.  An alternative is to wrap it in a:
   lambda *args: f(*args)
but I'd prefer not having to do that.

What version of the product are you using? On what operating system?
pgu from svn (r41).  Debian GNU/Linux Wheezy, but I suspect the issue is OS 
independent.

Original issue reported on code.google.com by NThykier@gmail.com on 7 Dec 2012 at 2:45

Attachments:

GoogleCodeExporter commented 9 years ago
Callbacks will now work (better) with callable objects (like partials)

Original comment by peter.ro...@gmail.com on 25 Dec 2012 at 4:22