2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 04:42:28 +00:00

str, dict, and tuple!

[SVN r14517]
This commit is contained in:
Dave Abrahams
2002-07-18 15:17:08 +00:00
parent 94edc13393
commit dfd85da9d7
18 changed files with 1419 additions and 537 deletions

View File

@@ -7,7 +7,7 @@
#include <boost/python/object/function.hpp>
#include <numeric>
#include <boost/python/errors.hpp>
#include <boost/python/objects2.hpp>
#include <boost/python/str.hpp>
#include <algorithm>
#include <cstring>
@@ -158,7 +158,7 @@ namespace
void function::add_to_namespace(
handle<> const& name_space, char const* name_, handle<> const& attribute)
{
string const name(name_);
str const name(name_);
PyObject* const ns = name_space.get();
if (attribute->ob_type == &function_type)
@@ -175,7 +175,7 @@ void function::add_to_namespace(
if (dict == 0)
throw_error_already_set();
handle<> existing( allow_null(PyObject_GetItem(dict, name.get())) );
handle<> existing( allow_null(PyObject_GetItem(dict, name.ptr())) );
if (existing.get())
{
@@ -195,7 +195,7 @@ void function::add_to_namespace(
// The PyObject_GetAttrString() call above left an active error
PyErr_Clear();
if (PyObject_SetAttr(ns, name.get(), attribute.get()) < 0)
if (PyObject_SetAttr(ns, name.ptr(), attribute.get()) < 0)
throw_error_already_set();
}