Opened 5 years ago

Closed 2 years ago

#16772 closed defect (outdated)

wxPython depends on PyMethod objects again - prevents full compatibility

Reported by: kayhayen Owned by:
Priority: normal Milestone:
Component: wxPython Version: 3.0.2
Keywords: Cc:
Blocked By: Blocking:
Patch: yes



this is similar to Issue#14025, again a portability patch.

I am the author of a Python compiler called Nuitka, which is fully compatible with Python and doesn't currently work correctly with "wx" anymore. Callbacks crash when called, if they are compiled

The cause for this is that wxPython uses "PyMethod_Function" which excludes some valid stuff of CPython too.

The attached patch provides an alternative implementation for cases where no "PyMethod" is encountered, by merely using "name" attribute instead.

With that change, it works nicely. I created the patch against current Debian Jessie version,, but I doubt there is much version dependent stuff going on there. So I leaving the default version.

As a bonus, this ought to be faster and simpler, since I removed the "HasAttr" checks before making "DelAttr". Since a "DelAttr" is only a define to "SetAttr" with NULL value, the "HasAttr" call is just wasted, "SetAttr" will NULL argument will do the job for us anyway.

Please apply the patch, as that will make wxPython supported with Nuitka again.

Kay Hayen

Attachments (1)

wxpython-nuitka-methods.patch download (1.2 KB) - added by kayhayen 5 years ago.
Patch to add support for non PyMethods

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by kayhayen

Patch to add support for non PyMethods

comment:1 Changed 2 years ago by robind

  • Resolution set to outdated
  • Status changed from new to closed

Closing old Phoenix tickets...

If this is still an issue in wxPython 4.0.0a1 then please open a new issue (or PR) at the wxPython-Phoenix project page on Github:

Note: See TracTickets for help on using tickets.