Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#90 "error: Callback must return an integer, or None" needs info

closed-fixed
nobody
pythonwin (20)
5
2012-04-24
2011-11-24
kxroberto
No

In win32ui apps "'error: Callback must return an integer, or None'" is raised without any info which callback function/method (and optionally which Hook/Window) it is about. No traceback stack as well. Thus it is quite impossible to locate the problem.

win32uimodule.cpp/Line 749:
PyErr_SetString(ui_module_error, "Callback must return an integer, or None");

There should be some info raised with the exception.

Discussion

  • Roger Upole
    Roger Upole
    2012-04-22

    This is actually worse than just a debugging nuisance. The code leaves an exception hanging, which further confuses the error handling, and will crash in python 3. I'll add the repr of the defective callback and make sure the original exception is printed and cleared.

     
  • Roger Upole
    Roger Upole
    2012-04-22

    • labels: 518341 --> pythonwin
     
  • Roger Upole
    Roger Upole
    2012-04-24

    • status: open --> closed-fixed
     
  • Roger Upole
    Roger Upole
    2012-04-24

    Fixed in changeset 4198. The message will show the repr() of the offending callback method.