Skip to content

Commit

Permalink
Some straight-forward changes for Python 3 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lotze committed May 18, 2016
1 parent 5d5b85d commit fee996e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
2.13.3 (unreleased)
-------------------

- Modernised C code in preparation of porting to Python 3.
- Ported to Python 3.

2.13.2 (2011-12-12)
-------------------
Expand Down
2 changes: 2 additions & 0 deletions include/ExtensionClass/ExtensionClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
#include "Python.h"
#include "import.h"

#define Py_TPFLAGS_HAVE_CLASS 0

/* Declarations for objects of type ExtensionClass */

#define EC PyTypeObject
Expand Down
12 changes: 6 additions & 6 deletions src/DocumentTemplate/cDocumentTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ typedef struct {
PyObject *guarded_getattr;
} InstanceDictobject;

staticforward PyExtensionClass InstanceDictType;
static PyExtensionClass InstanceDictType;

staticforward PyObject *_join_unicode(PyObject *prejoin);
static PyObject *_join_unicode(PyObject *prejoin);

static PyObject *
InstanceDict___init__(InstanceDictobject *self, PyObject *args)
Expand Down Expand Up @@ -188,7 +188,7 @@ static PyExtensionClass InstanceDictType = {
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*obsolete tp_getattr*/
(setattrfunc)0, /*obsolete tp_setattr*/
(cmpfunc)0, /*tp_compare*/
0, /*tp_compare*/
(reprfunc)InstanceDict_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand All @@ -212,7 +212,7 @@ typedef struct {
PyObject *data;
} MM;

staticforward PyExtensionClass MMtype;
static PyExtensionClass MMtype;

static PyObject *
MM_push(MM *self, PyObject *args)
Expand Down Expand Up @@ -535,7 +535,7 @@ static PyTypeObject DictInstanceType = {
(printfunc)0,
(getattrfunc)0,
(setattrfunc)0,
(cmpfunc)0,
0,
(reprfunc)0,
0, 0, 0,
(hashfunc)0,
Expand Down Expand Up @@ -616,7 +616,7 @@ static PyExtensionClass MMtype = {
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
(cmpfunc)0, /*tp_compare*/
0, /*tp_compare*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down

0 comments on commit fee996e

Please sign in to comment.