diff options
author | John Ehresman <jpe@wingware.com> | 2010-04-02 16:08:07 -0400 |
---|---|---|
committer | John Ehresman <jpe@wingware.com> | 2010-04-15 12:13:34 -0400 |
commit | 13a5da14842caa6a80e6ed7237422b984a152cd8 (patch) | |
tree | aa4139bf93ffd7730850057c9f4de975068294a8 /codegen/codegen.py | |
parent | 681832c3cd040433a488a400693b68f213bf7078 (diff) | |
download | pygobject-13a5da14842caa6a80e6ed7237422b984a152cd8.tar.gz pygobject-13a5da14842caa6a80e6ed7237422b984a152cd8.tar.xz pygobject-13a5da14842caa6a80e6ed7237422b984a152cd8.zip |
Use richcompare slot rather than old compare slot and Py_TYPE macro in preparation for py3k support
Diffstat (limited to 'codegen/codegen.py')
-rwxr-xr-x | codegen/codegen.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/codegen/codegen.py b/codegen/codegen.py index 73324a5..7a1f7e6 100755 --- a/codegen/codegen.py +++ b/codegen/codegen.py @@ -76,7 +76,7 @@ class FileOutput: # handle writing to the file, and keep track of the line number ... def write(self, str): self.fp.write(str) - self.lineno = self.lineno + string.count(str, '\n') + self.lineno = self.lineno + str.count('\n') def writelines(self, sequence): for line in sequence: self.write(line) @@ -96,8 +96,7 @@ class FileOutput: class Wrapper: type_tmpl = ( 'PyTypeObject G_GNUC_INTERNAL Py%(typename)s_Type = {\n' - ' PyObject_HEAD_INIT(NULL)\n' - ' 0, /* ob_size */\n' + ' PyVarObject_HEAD_INIT(NULL, 0)' ' "%(classname)s", /* tp_name */\n' ' sizeof(%(tp_basicsize)s), /* tp_basicsize */\n' ' 0, /* tp_itemsize */\n' @@ -106,7 +105,7 @@ class Wrapper: ' (printfunc)0, /* tp_print */\n' ' (getattrfunc)%(tp_getattr)s, /* tp_getattr */\n' ' (setattrfunc)%(tp_setattr)s, /* tp_setattr */\n' - ' (cmpfunc)%(tp_compare)s, /* tp_compare */\n' + ' NULL, //%(tp_compare)s, /* tp_compare */\n' ' (reprfunc)%(tp_repr)s, /* tp_repr */\n' ' (PyNumberMethods*)%(tp_as_number)s, /* tp_as_number */\n' ' (PySequenceMethods*)%(tp_as_sequence)s, /* tp_as_sequence */\n' |