Skip to content

Commit 28eef45

Browse files
author
Ralf W. Grosse-Kunstleve
committed
enum_print() removed; it was not reachable anyway since enum inherits
from Python's built-in int type. However, the appearance of FILE* raised questions about using extensions compiled with Visual C++ 8 with a Python compiled with Visual C++ 7.1. [SVN r32301]
1 parent d8790a3 commit 28eef45

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

src/object/enum.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <boost/python/extract.hpp>
1414
#include <boost/python/object_protocol.hpp>
1515
#include <structmember.h>
16-
#include <cstdio>
1716

1817
namespace boost { namespace python { namespace objects {
1918

@@ -31,23 +30,6 @@ static PyMemberDef enum_members[] = {
3130

3231
extern "C"
3332
{
34-
static int
35-
enum_print(PyObject *v, BOOST_CSTD_::FILE *fp, int flags)
36-
{
37-
PyObject* s
38-
= (flags & Py_PRINT_RAW) ? v->ob_type->tp_str(v) : v->ob_type->tp_repr(v);
39-
if (s == 0)
40-
return -1;
41-
42-
char const* text = PyString_AsString(s);
43-
if (text == 0)
44-
return -1;
45-
46-
BOOST_CSTD_::fprintf(fp, text);
47-
return 0;
48-
}
49-
50-
/* flags -- not used but required by interface */
5133
static PyObject* enum_repr(PyObject* self_)
5234
{
5335
enum_object* self = downcast<enum_object>(self_);
@@ -86,7 +68,7 @@ static PyTypeObject enum_type_object = {
8668
sizeof(enum_object), /* tp_basicsize */
8769
0, /* tp_itemsize */
8870
0, /* tp_dealloc */
89-
enum_print, /* tp_print */
71+
0, /* tp_print */
9072
0, /* tp_getattr */
9173
0, /* tp_setattr */
9274
0, /* tp_compare */

0 commit comments

Comments
 (0)