add_function doesn't use custom_name for generated wrapper code

Bug #1286502 reported by Kevin Stenerson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyBindGen
Fix Committed
Undecided
Unassigned

Bug Description

The Module.add_function method uses the normal name instead of the custom_name for the generated wrapper function's name.

Class.add_method handles this correctly so that if I were to call the following:
    cls.add_method('get_foo', retval('int'), [])
    cls.add_method('get_foo', retval('int'), [], custom_name = 'getFoo')

It produces:
    _wrap_PyModulenameClassname_get_foo
    _wrap_PyModulenameClassname_getFoo

However, the same thing with add_function:
    mod.add_function('get_foo', retval('int'), [])
    mod.add_function('get_foo', retval('int'), [], custom_name = 'getFoo')

Will produce:
    _wrap_modulename_get_foo
    _wrap_modulename_get_foo

and cause the error:
  redefinition of ‘PyObject* _wrap_modulename_get_foo(PyObject*)’

Revision history for this message
Kevin Stenerson (stenersonkevin) wrote :

Submitting patch.

Revision history for this message
Gustavo Carneiro (gjc) wrote :

Thank you.

Changed in pybindgen:
status: New → Fix Committed
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.