You can bind it as an attribute of the module with, e.g.,
m.attr("ERR_FAIL") = my_namespace::ERR_FAIL;
This gist has a complete example.