[Python-3000-checkins] r56492 - in python/branches/py3k-struni: Lib/idlelib/CallTips.py Lib/idlelib/ScriptBinding.py Mac/Modules/MacOS.c Mac/Modules/ae/_AEmodule.c Mac/Modules/app/_Appmodule.c Mac/Modules/carbonevt/_CarbonEvtmodule.c Mac/Modules/cf/_CFmodule.c Mac/Modules/cg/_CGmodule.c Mac/Modules/cm/_Cmmodule.c Mac/Modules/ctl/_Ctlmodule.c Mac/Modules/dlg/_Dlgmodule.c Mac/Modules/drag/_Dragmodule.c Mac/Modules/file/_Filemodule.c Mac/Modules/ibcarbon/_IBCarbon.c Mac/Modules/list/_Listmodule.c Mac/Modules/menu/_Menumodule.c Mac/Modules/mlte/_Mltemodule.c Mac/Modules/osa/_OSAmodule.c Mac/Modules/qd/_Qdmodule.c Mac/Modules/qdoffs/_Qdoffsmodule.c Mac/Modules/qt/_Qtmodule.c Mac/Modules/res/_Resmodule.c Mac/Modules/scrap/_Scrapmodule.c Mac/Modules/snd/_Sndmodule.c Mac/Modules/te/_TEmodule.c Mac/Modules/win/_Winmodule.c PC/_subprocess.c PC/_winreg.c

martin.v.loewis python-3000-checkins at python.org
Sun Jul 22 16:41:57 CEST 2007


Author: martin.v.loewis
Date: Sun Jul 22 16:41:55 2007
New Revision: 56492

Modified:
   python/branches/py3k-struni/   (props changed)
   python/branches/py3k-struni/Lib/idlelib/CallTips.py
   python/branches/py3k-struni/Lib/idlelib/ScriptBinding.py
   python/branches/py3k-struni/Mac/Modules/MacOS.c
   python/branches/py3k-struni/Mac/Modules/ae/_AEmodule.c
   python/branches/py3k-struni/Mac/Modules/app/_Appmodule.c
   python/branches/py3k-struni/Mac/Modules/carbonevt/_CarbonEvtmodule.c
   python/branches/py3k-struni/Mac/Modules/cf/_CFmodule.c
   python/branches/py3k-struni/Mac/Modules/cg/_CGmodule.c
   python/branches/py3k-struni/Mac/Modules/cm/_Cmmodule.c
   python/branches/py3k-struni/Mac/Modules/ctl/_Ctlmodule.c
   python/branches/py3k-struni/Mac/Modules/dlg/_Dlgmodule.c
   python/branches/py3k-struni/Mac/Modules/drag/_Dragmodule.c
   python/branches/py3k-struni/Mac/Modules/file/_Filemodule.c
   python/branches/py3k-struni/Mac/Modules/ibcarbon/_IBCarbon.c
   python/branches/py3k-struni/Mac/Modules/list/_Listmodule.c
   python/branches/py3k-struni/Mac/Modules/menu/_Menumodule.c
   python/branches/py3k-struni/Mac/Modules/mlte/_Mltemodule.c
   python/branches/py3k-struni/Mac/Modules/osa/_OSAmodule.c
   python/branches/py3k-struni/Mac/Modules/qd/_Qdmodule.c
   python/branches/py3k-struni/Mac/Modules/qdoffs/_Qdoffsmodule.c
   python/branches/py3k-struni/Mac/Modules/qt/_Qtmodule.c
   python/branches/py3k-struni/Mac/Modules/res/_Resmodule.c
   python/branches/py3k-struni/Mac/Modules/scrap/_Scrapmodule.c
   python/branches/py3k-struni/Mac/Modules/snd/_Sndmodule.c
   python/branches/py3k-struni/Mac/Modules/te/_TEmodule.c
   python/branches/py3k-struni/Mac/Modules/win/_Winmodule.c
   python/branches/py3k-struni/PC/_subprocess.c
   python/branches/py3k-struni/PC/_winreg.c
Log:
Merged revisions 56483-56491 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/p3yk

........
  r56486 | kurt.kaiser | 2007-07-22 05:27:08 +0200 (So, 22 Jul 2007) | 2 lines
  
  Fix typo introduced at r55797
........
  r56487 | kurt.kaiser | 2007-07-22 07:48:45 +0200 (So, 22 Jul 2007) | 2 lines
  
  Exception attr accessed via args in py3k.
........
  r56489 | martin.v.loewis | 2007-07-22 15:32:44 +0200 (So, 22 Jul 2007) | 2 lines
  
  Regenerate.
........
  r56490 | martin.v.loewis | 2007-07-22 15:34:06 +0200 (So, 22 Jul 2007) | 2 lines
  
  Port Mac modules to PEP 3123.
........
  r56491 | martin.v.loewis | 2007-07-22 16:35:53 +0200 (So, 22 Jul 2007) | 1 line
  
  Port to PEP 3123.
........


Modified: python/branches/py3k-struni/Lib/idlelib/CallTips.py
==============================================================================
--- python/branches/py3k-struni/Lib/idlelib/CallTips.py	(original)
+++ python/branches/py3k-struni/Lib/idlelib/CallTips.py	Sun Jul 22 16:41:55 2007
@@ -138,7 +138,7 @@
                 fob = lambda: None
             else:
                 arg_offset = 1
-        elif isinstace(ob, types.MethodType):
+        elif isinstance(ob, types.MethodType):
             # bit of a hack for methods - turn it into a function
             # but we drop the "self" param.
             fob = ob.im_func

Modified: python/branches/py3k-struni/Lib/idlelib/ScriptBinding.py
==============================================================================
--- python/branches/py3k-struni/Lib/idlelib/ScriptBinding.py	(original)
+++ python/branches/py3k-struni/Lib/idlelib/ScriptBinding.py	Sun Jul 22 16:41:55 2007
@@ -99,13 +99,13 @@
                 return compile(source, filename, "exec")
             except (SyntaxError, OverflowError) as err:
                 try:
-                    msg, (errorfilename, lineno, offset, line) = err
+                    msg, (errorfilename, lineno, offset, line) = err.args
                     if not errorfilename:
                         err.args = msg, (filename, lineno, offset, line)
                         err.filename = filename
                     self.colorize_syntax_error(msg, lineno, offset)
                 except:
-                    msg = "*** " + str(err)
+                    msg = str(err)
                 self.errorbox("Syntax error",
                               "There's an error in your program:\n" + msg)
                 return False

Modified: python/branches/py3k-struni/Mac/Modules/MacOS.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/MacOS.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/MacOS.c	Sun Jul 22 16:41:55 2007
@@ -257,8 +257,7 @@
 ;
 
 static PyTypeObject Rftype = {
-	PyObject_HEAD_INIT(&PyType_Type)
-	0,				/*ob_size*/
+	PyVarObject_HEAD_INIT(&PyType_Type, 0)
 	"MacOS.ResourceFork",		/*tp_name*/
 	sizeof(rfobject),		/*tp_basicsize*/
 	0,				/*tp_itemsize*/
@@ -610,7 +609,7 @@
 	MacOS_Error = PyMac_GetOSErrException();
 	if (MacOS_Error == NULL || PyDict_SetItemString(d, "Error", MacOS_Error) != 0)
 		return;
-	Rftype.ob_type = &PyType_Type;
+	Py_Type(&Rftype) = &PyType_Type;
 	Py_INCREF(&Rftype);
 	if (PyDict_SetItemString(d, "ResourceForkType", (PyObject *)&Rftype) != 0)
 		return;

Modified: python/branches/py3k-struni/Mac/Modules/ae/_AEmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/ae/_AEmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/ae/_AEmodule.c	Sun Jul 22 16:41:55 2007
@@ -47,7 +47,7 @@
 
 PyTypeObject AEDesc_Type;
 
-#define AEDesc_Check(x) ((x)->ob_type == &AEDesc_Type || PyObject_TypeCheck((x), &AEDesc_Type))
+#define AEDesc_Check(x) (Py_Type(x) == &AEDesc_Type || PyObject_TypeCheck((x), &AEDesc_Type))
 
 typedef struct AEDescObject {
 	PyObject_HEAD
@@ -79,7 +79,7 @@
 static void AEDesc_dealloc(AEDescObject *self)
 {
 	if (self->ob_owned) AEDisposeDesc(&self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *AEDesc_AECoerceDesc(AEDescObject *_self, PyObject *_args)
@@ -878,8 +878,7 @@
 
 
 PyTypeObject AEDesc_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_AE.AEDesc", /*tp_name*/
 	sizeof(AEDescObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1441,7 +1440,7 @@
 	if (AE_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", AE_Error) != 0)
 		return;
-	AEDesc_Type.ob_type = &PyType_Type;
+	Py_Type(&AEDesc_Type) = &PyType_Type;
 	if (PyType_Ready(&AEDesc_Type) < 0) return;
 	Py_INCREF(&AEDesc_Type);
 	PyModule_AddObject(m, "AEDesc", (PyObject *)&AEDesc_Type);

Modified: python/branches/py3k-struni/Mac/Modules/app/_Appmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/app/_Appmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/app/_Appmodule.c	Sun Jul 22 16:41:55 2007
@@ -30,7 +30,7 @@
 
 PyTypeObject ThemeDrawingState_Type;
 
-#define ThemeDrawingStateObj_Check(x) ((x)->ob_type == &ThemeDrawingState_Type || PyObject_TypeCheck((x), &ThemeDrawingState_Type))
+#define ThemeDrawingStateObj_Check(x) (Py_Type(x) == &ThemeDrawingState_Type || PyObject_TypeCheck((x), &ThemeDrawingState_Type))
 
 typedef struct ThemeDrawingStateObject {
 	PyObject_HEAD
@@ -60,7 +60,7 @@
 static void ThemeDrawingStateObj_dealloc(ThemeDrawingStateObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
@@ -132,8 +132,7 @@
 
 
 PyTypeObject ThemeDrawingState_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_App.ThemeDrawingState", /*tp_name*/
 	sizeof(ThemeDrawingStateObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1808,7 +1807,7 @@
 	if (App_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", App_Error) != 0)
 		return;
-	ThemeDrawingState_Type.ob_type = &PyType_Type;
+	Py_Type(&ThemeDrawingState_Type) = &PyType_Type;
 	if (PyType_Ready(&ThemeDrawingState_Type) < 0) return;
 	Py_INCREF(&ThemeDrawingState_Type);
 	PyModule_AddObject(m, "ThemeDrawingState", (PyObject *)&ThemeDrawingState_Type);

Modified: python/branches/py3k-struni/Mac/Modules/carbonevt/_CarbonEvtmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/carbonevt/_CarbonEvtmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/carbonevt/_CarbonEvtmodule.c	Sun Jul 22 16:41:55 2007
@@ -151,7 +151,7 @@
 static void EventRef_dealloc(EventRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventRef_RetainEvent(EventRefObject *_self, PyObject *_args)
@@ -416,8 +416,7 @@
 
 
 PyTypeObject EventRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventRef", /*tp_name*/
 	sizeof(EventRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -496,7 +495,7 @@
 static void EventQueueRef_dealloc(EventQueueRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventQueueRef_PostEventToQueue(EventQueueRefObject *_self, PyObject *_args)
@@ -637,8 +636,7 @@
 
 
 PyTypeObject EventQueueRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventQueueRef", /*tp_name*/
 	sizeof(EventQueueRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -717,7 +715,7 @@
 static void EventLoopRef_dealloc(EventLoopRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventLoopRef_QuitEventLoop(EventLoopRefObject *_self, PyObject *_args)
@@ -767,8 +765,7 @@
 
 
 PyTypeObject EventLoopRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventLoopRef", /*tp_name*/
 	sizeof(EventLoopRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -847,7 +844,7 @@
 static void EventLoopTimerRef_dealloc(EventLoopTimerRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventLoopTimerRef_RemoveEventLoopTimer(EventLoopTimerRefObject *_self, PyObject *_args)
@@ -915,8 +912,7 @@
 
 
 PyTypeObject EventLoopTimerRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventLoopTimerRef", /*tp_name*/
 	sizeof(EventLoopTimerRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1000,7 +996,7 @@
 		RemoveEventHandler(self->ob_itself);
 		Py_DECREF(self->ob_callback);
 	}
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHandlerRef_AddEventTypesToHandler(EventHandlerRefObject *_self, PyObject *_args)
@@ -1108,8 +1104,7 @@
 
 
 PyTypeObject EventHandlerRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventHandlerRef", /*tp_name*/
 	sizeof(EventHandlerRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1188,7 +1183,7 @@
 static void EventHandlerCallRef_dealloc(EventHandlerCallRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHandlerCallRef_CallNextEventHandler(EventHandlerCallRefObject *_self, PyObject *_args)
@@ -1241,8 +1236,7 @@
 
 
 PyTypeObject EventHandlerCallRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventHandlerCallRef", /*tp_name*/
 	sizeof(EventHandlerCallRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1321,7 +1315,7 @@
 static void EventTargetRef_dealloc(EventTargetRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventTargetRef_InstallStandardEventHandler(EventTargetRefObject *_self, PyObject *_args)
@@ -1396,8 +1390,7 @@
 
 
 PyTypeObject EventTargetRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventTargetRef", /*tp_name*/
 	sizeof(EventTargetRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1476,7 +1469,7 @@
 static void EventHotKeyRef_dealloc(EventHotKeyRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHotKeyRef_UnregisterEventHotKey(EventHotKeyRefObject *_self, PyObject *_args)
@@ -1526,8 +1519,7 @@
 
 
 PyTypeObject EventHotKeyRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CarbonEvt.EventHotKeyRef", /*tp_name*/
 	sizeof(EventHotKeyRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -2160,56 +2152,56 @@
 	if (CarbonEvents_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", CarbonEvents_Error) != 0)
 		return;
-	EventRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventRef_Type) < 0) return;
 	Py_INCREF(&EventRef_Type);
 	PyModule_AddObject(m, "EventRef", (PyObject *)&EventRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventRef_Type);
 	PyModule_AddObject(m, "EventRefType", (PyObject *)&EventRef_Type);
-	EventQueueRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventQueueRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventQueueRef_Type) < 0) return;
 	Py_INCREF(&EventQueueRef_Type);
 	PyModule_AddObject(m, "EventQueueRef", (PyObject *)&EventQueueRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventQueueRef_Type);
 	PyModule_AddObject(m, "EventQueueRefType", (PyObject *)&EventQueueRef_Type);
-	EventLoopRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventLoopRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventLoopRef_Type) < 0) return;
 	Py_INCREF(&EventLoopRef_Type);
 	PyModule_AddObject(m, "EventLoopRef", (PyObject *)&EventLoopRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventLoopRef_Type);
 	PyModule_AddObject(m, "EventLoopRefType", (PyObject *)&EventLoopRef_Type);
-	EventLoopTimerRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventLoopTimerRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventLoopTimerRef_Type) < 0) return;
 	Py_INCREF(&EventLoopTimerRef_Type);
 	PyModule_AddObject(m, "EventLoopTimerRef", (PyObject *)&EventLoopTimerRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventLoopTimerRef_Type);
 	PyModule_AddObject(m, "EventLoopTimerRefType", (PyObject *)&EventLoopTimerRef_Type);
-	EventHandlerRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventHandlerRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventHandlerRef_Type) < 0) return;
 	Py_INCREF(&EventHandlerRef_Type);
 	PyModule_AddObject(m, "EventHandlerRef", (PyObject *)&EventHandlerRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventHandlerRef_Type);
 	PyModule_AddObject(m, "EventHandlerRefType", (PyObject *)&EventHandlerRef_Type);
-	EventHandlerCallRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventHandlerCallRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventHandlerCallRef_Type) < 0) return;
 	Py_INCREF(&EventHandlerCallRef_Type);
 	PyModule_AddObject(m, "EventHandlerCallRef", (PyObject *)&EventHandlerCallRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventHandlerCallRef_Type);
 	PyModule_AddObject(m, "EventHandlerCallRefType", (PyObject *)&EventHandlerCallRef_Type);
-	EventTargetRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventTargetRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventTargetRef_Type) < 0) return;
 	Py_INCREF(&EventTargetRef_Type);
 	PyModule_AddObject(m, "EventTargetRef", (PyObject *)&EventTargetRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventTargetRef_Type);
 	PyModule_AddObject(m, "EventTargetRefType", (PyObject *)&EventTargetRef_Type);
-	EventHotKeyRef_Type.ob_type = &PyType_Type;
+	Py_Type(&EventHotKeyRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventHotKeyRef_Type) < 0) return;
 	Py_INCREF(&EventHotKeyRef_Type);
 	PyModule_AddObject(m, "EventHotKeyRef", (PyObject *)&EventHotKeyRef_Type);

Modified: python/branches/py3k-struni/Mac/Modules/cf/_CFmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/cf/_CFmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/cf/_CFmodule.c	Sun Jul 22 16:41:55 2007
@@ -116,7 +116,7 @@
 
 PyTypeObject CFTypeRef_Type;
 
-#define CFTypeRefObj_Check(x) ((x)->ob_type == &CFTypeRef_Type || PyObject_TypeCheck((x), &CFTypeRef_Type))
+#define CFTypeRefObj_Check(x) (Py_Type(x) == &CFTypeRef_Type || PyObject_TypeCheck((x), &CFTypeRef_Type))
 
 typedef struct CFTypeRefObject {
 	PyObject_HEAD
@@ -161,7 +161,7 @@
 		self->ob_freeit((CFTypeRef)self->ob_itself);
 		self->ob_itself = NULL;
 	}
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CFTypeRefObj_CFGetTypeID(CFTypeRefObject *_self, PyObject *_args)
@@ -428,8 +428,7 @@
 
 
 PyTypeObject CFTypeRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFTypeRef", /*tp_name*/
 	sizeof(CFTypeRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -478,7 +477,7 @@
 
 PyTypeObject CFArrayRef_Type;
 
-#define CFArrayRefObj_Check(x) ((x)->ob_type == &CFArrayRef_Type || PyObject_TypeCheck((x), &CFArrayRef_Type))
+#define CFArrayRefObj_Check(x) (Py_Type(x) == &CFArrayRef_Type || PyObject_TypeCheck((x), &CFArrayRef_Type))
 
 typedef struct CFArrayRefObject {
 	PyObject_HEAD
@@ -639,8 +638,7 @@
 
 
 PyTypeObject CFArrayRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFArrayRef", /*tp_name*/
 	sizeof(CFArrayRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -689,7 +687,7 @@
 
 PyTypeObject CFMutableArrayRef_Type;
 
-#define CFMutableArrayRefObj_Check(x) ((x)->ob_type == &CFMutableArrayRef_Type || PyObject_TypeCheck((x), &CFMutableArrayRef_Type))
+#define CFMutableArrayRefObj_Check(x) (Py_Type(x) == &CFMutableArrayRef_Type || PyObject_TypeCheck((x), &CFMutableArrayRef_Type))
 
 typedef struct CFMutableArrayRefObject {
 	PyObject_HEAD
@@ -879,8 +877,7 @@
 
 
 PyTypeObject CFMutableArrayRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFMutableArrayRef", /*tp_name*/
 	sizeof(CFMutableArrayRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -929,7 +926,7 @@
 
 PyTypeObject CFDictionaryRef_Type;
 
-#define CFDictionaryRefObj_Check(x) ((x)->ob_type == &CFDictionaryRef_Type || PyObject_TypeCheck((x), &CFDictionaryRef_Type))
+#define CFDictionaryRefObj_Check(x) (Py_Type(x) == &CFDictionaryRef_Type || PyObject_TypeCheck((x), &CFDictionaryRef_Type))
 
 typedef struct CFDictionaryRefObject {
 	PyObject_HEAD
@@ -1072,8 +1069,7 @@
 
 
 PyTypeObject CFDictionaryRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFDictionaryRef", /*tp_name*/
 	sizeof(CFDictionaryRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1122,7 +1118,7 @@
 
 PyTypeObject CFMutableDictionaryRef_Type;
 
-#define CFMutableDictionaryRefObj_Check(x) ((x)->ob_type == &CFMutableDictionaryRef_Type || PyObject_TypeCheck((x), &CFMutableDictionaryRef_Type))
+#define CFMutableDictionaryRefObj_Check(x) (Py_Type(x) == &CFMutableDictionaryRef_Type || PyObject_TypeCheck((x), &CFMutableDictionaryRef_Type))
 
 typedef struct CFMutableDictionaryRefObject {
 	PyObject_HEAD
@@ -1249,8 +1245,7 @@
 
 
 PyTypeObject CFMutableDictionaryRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFMutableDictionaryRef", /*tp_name*/
 	sizeof(CFMutableDictionaryRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1299,7 +1294,7 @@
 
 PyTypeObject CFDataRef_Type;
 
-#define CFDataRefObj_Check(x) ((x)->ob_type == &CFDataRef_Type || PyObject_TypeCheck((x), &CFDataRef_Type))
+#define CFDataRefObj_Check(x) (Py_Type(x) == &CFDataRef_Type || PyObject_TypeCheck((x), &CFDataRef_Type))
 
 typedef struct CFDataRefObject {
 	PyObject_HEAD
@@ -1480,8 +1475,7 @@
 
 
 PyTypeObject CFDataRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFDataRef", /*tp_name*/
 	sizeof(CFDataRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1530,7 +1524,7 @@
 
 PyTypeObject CFMutableDataRef_Type;
 
-#define CFMutableDataRefObj_Check(x) ((x)->ob_type == &CFMutableDataRef_Type || PyObject_TypeCheck((x), &CFMutableDataRef_Type))
+#define CFMutableDataRefObj_Check(x) (Py_Type(x) == &CFMutableDataRef_Type || PyObject_TypeCheck((x), &CFMutableDataRef_Type))
 
 typedef struct CFMutableDataRefObject {
 	PyObject_HEAD
@@ -1745,8 +1739,7 @@
 
 
 PyTypeObject CFMutableDataRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFMutableDataRef", /*tp_name*/
 	sizeof(CFMutableDataRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1795,7 +1788,7 @@
 
 PyTypeObject CFStringRef_Type;
 
-#define CFStringRefObj_Check(x) ((x)->ob_type == &CFStringRef_Type || PyObject_TypeCheck((x), &CFStringRef_Type))
+#define CFStringRefObj_Check(x) (Py_Type(x) == &CFStringRef_Type || PyObject_TypeCheck((x), &CFStringRef_Type))
 
 typedef struct CFStringRefObject {
 	PyObject_HEAD
@@ -2487,8 +2480,7 @@
 
 
 PyTypeObject CFStringRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFStringRef", /*tp_name*/
 	sizeof(CFStringRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -2537,7 +2529,7 @@
 
 PyTypeObject CFMutableStringRef_Type;
 
-#define CFMutableStringRefObj_Check(x) ((x)->ob_type == &CFMutableStringRef_Type || PyObject_TypeCheck((x), &CFMutableStringRef_Type))
+#define CFMutableStringRefObj_Check(x) (Py_Type(x) == &CFMutableStringRef_Type || PyObject_TypeCheck((x), &CFMutableStringRef_Type))
 
 typedef struct CFMutableStringRefObject {
 	PyObject_HEAD
@@ -2875,8 +2867,7 @@
 
 
 PyTypeObject CFMutableStringRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFMutableStringRef", /*tp_name*/
 	sizeof(CFMutableStringRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -2925,7 +2916,7 @@
 
 PyTypeObject CFURLRef_Type;
 
-#define CFURLRefObj_Check(x) ((x)->ob_type == &CFURLRef_Type || PyObject_TypeCheck((x), &CFURLRef_Type))
+#define CFURLRefObj_Check(x) (Py_Type(x) == &CFURLRef_Type || PyObject_TypeCheck((x), &CFURLRef_Type))
 
 typedef struct CFURLRefObject {
 	PyObject_HEAD
@@ -3527,8 +3518,7 @@
 
 
 PyTypeObject CFURLRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CF.CFURLRef", /*tp_name*/
 	sizeof(CFURLRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -4899,14 +4889,14 @@
 	if (CF_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", CF_Error) != 0)
 		return;
-	CFTypeRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFTypeRef_Type) = &PyType_Type;
 	if (PyType_Ready(&CFTypeRef_Type) < 0) return;
 	Py_INCREF(&CFTypeRef_Type);
 	PyModule_AddObject(m, "CFTypeRef", (PyObject *)&CFTypeRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&CFTypeRef_Type);
 	PyModule_AddObject(m, "CFTypeRefType", (PyObject *)&CFTypeRef_Type);
-	CFArrayRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFArrayRef_Type) = &PyType_Type;
 	CFArrayRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFArrayRef_Type) < 0) return;
 	Py_INCREF(&CFArrayRef_Type);
@@ -4914,7 +4904,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFArrayRef_Type);
 	PyModule_AddObject(m, "CFArrayRefType", (PyObject *)&CFArrayRef_Type);
-	CFMutableArrayRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFMutableArrayRef_Type) = &PyType_Type;
 	CFMutableArrayRef_Type.tp_base = &CFArrayRef_Type;
 	if (PyType_Ready(&CFMutableArrayRef_Type) < 0) return;
 	Py_INCREF(&CFMutableArrayRef_Type);
@@ -4922,7 +4912,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableArrayRef_Type);
 	PyModule_AddObject(m, "CFMutableArrayRefType", (PyObject *)&CFMutableArrayRef_Type);
-	CFDictionaryRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFDictionaryRef_Type) = &PyType_Type;
 	CFDictionaryRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFDictionaryRef_Type) < 0) return;
 	Py_INCREF(&CFDictionaryRef_Type);
@@ -4930,7 +4920,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFDictionaryRef_Type);
 	PyModule_AddObject(m, "CFDictionaryRefType", (PyObject *)&CFDictionaryRef_Type);
-	CFMutableDictionaryRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFMutableDictionaryRef_Type) = &PyType_Type;
 	CFMutableDictionaryRef_Type.tp_base = &CFDictionaryRef_Type;
 	if (PyType_Ready(&CFMutableDictionaryRef_Type) < 0) return;
 	Py_INCREF(&CFMutableDictionaryRef_Type);
@@ -4938,7 +4928,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableDictionaryRef_Type);
 	PyModule_AddObject(m, "CFMutableDictionaryRefType", (PyObject *)&CFMutableDictionaryRef_Type);
-	CFDataRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFDataRef_Type) = &PyType_Type;
 	CFDataRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFDataRef_Type) < 0) return;
 	Py_INCREF(&CFDataRef_Type);
@@ -4946,7 +4936,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFDataRef_Type);
 	PyModule_AddObject(m, "CFDataRefType", (PyObject *)&CFDataRef_Type);
-	CFMutableDataRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFMutableDataRef_Type) = &PyType_Type;
 	CFMutableDataRef_Type.tp_base = &CFDataRef_Type;
 	if (PyType_Ready(&CFMutableDataRef_Type) < 0) return;
 	Py_INCREF(&CFMutableDataRef_Type);
@@ -4954,7 +4944,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableDataRef_Type);
 	PyModule_AddObject(m, "CFMutableDataRefType", (PyObject *)&CFMutableDataRef_Type);
-	CFStringRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFStringRef_Type) = &PyType_Type;
 	CFStringRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFStringRef_Type) < 0) return;
 	Py_INCREF(&CFStringRef_Type);
@@ -4962,7 +4952,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFStringRef_Type);
 	PyModule_AddObject(m, "CFStringRefType", (PyObject *)&CFStringRef_Type);
-	CFMutableStringRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFMutableStringRef_Type) = &PyType_Type;
 	CFMutableStringRef_Type.tp_base = &CFStringRef_Type;
 	if (PyType_Ready(&CFMutableStringRef_Type) < 0) return;
 	Py_INCREF(&CFMutableStringRef_Type);
@@ -4970,7 +4960,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableStringRef_Type);
 	PyModule_AddObject(m, "CFMutableStringRefType", (PyObject *)&CFMutableStringRef_Type);
-	CFURLRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CFURLRef_Type) = &PyType_Type;
 	CFURLRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFURLRef_Type) < 0) return;
 	Py_INCREF(&CFURLRef_Type);

Modified: python/branches/py3k-struni/Mac/Modules/cg/_CGmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/cg/_CGmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/cg/_CGmodule.c	Sun Jul 22 16:41:55 2007
@@ -95,7 +95,7 @@
 
 PyTypeObject CGContextRef_Type;
 
-#define CGContextRefObj_Check(x) ((x)->ob_type == &CGContextRef_Type || PyObject_TypeCheck((x), &CGContextRef_Type))
+#define CGContextRefObj_Check(x) (Py_Type(x) == &CGContextRef_Type || PyObject_TypeCheck((x), &CGContextRef_Type))
 
 typedef struct CGContextRefObject {
 	PyObject_HEAD
@@ -125,7 +125,7 @@
 static void CGContextRefObj_dealloc(CGContextRefObject *self)
 {
 	CGContextRelease(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CGContextRefObj_CGContextSaveGState(CGContextRefObject *_self, PyObject *_args)
@@ -1208,8 +1208,7 @@
 
 
 PyTypeObject CGContextRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_CG.CGContextRef", /*tp_name*/
 	sizeof(CGContextRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1295,7 +1294,7 @@
 	if (CG_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", CG_Error) != 0)
 		return;
-	CGContextRef_Type.ob_type = &PyType_Type;
+	Py_Type(&CGContextRef_Type) = &PyType_Type;
 	if (PyType_Ready(&CGContextRef_Type) < 0) return;
 	Py_INCREF(&CGContextRef_Type);
 	PyModule_AddObject(m, "CGContextRef", (PyObject *)&CGContextRef_Type);

Modified: python/branches/py3k-struni/Mac/Modules/cm/_Cmmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/cm/_Cmmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/cm/_Cmmodule.c	Sun Jul 22 16:41:55 2007
@@ -60,7 +60,7 @@
 
 PyTypeObject ComponentInstance_Type;
 
-#define CmpInstObj_Check(x) ((x)->ob_type == &ComponentInstance_Type || PyObject_TypeCheck((x), &ComponentInstance_Type))
+#define CmpInstObj_Check(x) (Py_Type(x) == &ComponentInstance_Type || PyObject_TypeCheck((x), &ComponentInstance_Type))
 
 typedef struct ComponentInstanceObject {
 	PyObject_HEAD
@@ -94,7 +94,7 @@
 static void CmpInstObj_dealloc(ComponentInstanceObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CmpInstObj_CloseComponent(ComponentInstanceObject *_self, PyObject *_args)
@@ -277,8 +277,7 @@
 
 
 PyTypeObject ComponentInstance_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Cm.ComponentInstance", /*tp_name*/
 	sizeof(ComponentInstanceObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -327,7 +326,7 @@
 
 PyTypeObject Component_Type;
 
-#define CmpObj_Check(x) ((x)->ob_type == &Component_Type || PyObject_TypeCheck((x), &Component_Type))
+#define CmpObj_Check(x) (Py_Type(x) == &Component_Type || PyObject_TypeCheck((x), &Component_Type))
 
 typedef struct ComponentObject {
 	PyObject_HEAD
@@ -366,7 +365,7 @@
 static void CmpObj_dealloc(ComponentObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CmpObj_UnregisterComponent(ComponentObject *_self, PyObject *_args)
@@ -711,8 +710,7 @@
 
 
 PyTypeObject Component_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Cm.Component", /*tp_name*/
 	sizeof(ComponentObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -927,14 +925,14 @@
 	if (Cm_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Cm_Error) != 0)
 		return;
-	ComponentInstance_Type.ob_type = &PyType_Type;
+	Py_Type(&ComponentInstance_Type) = &PyType_Type;
 	if (PyType_Ready(&ComponentInstance_Type) < 0) return;
 	Py_INCREF(&ComponentInstance_Type);
 	PyModule_AddObject(m, "ComponentInstance", (PyObject *)&ComponentInstance_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&ComponentInstance_Type);
 	PyModule_AddObject(m, "ComponentInstanceType", (PyObject *)&ComponentInstance_Type);
-	Component_Type.ob_type = &PyType_Type;
+	Py_Type(&Component_Type) = &PyType_Type;
 	if (PyType_Ready(&Component_Type) < 0) return;
 	Py_INCREF(&Component_Type);
 	PyModule_AddObject(m, "Component", (PyObject *)&Component_Type);

Modified: python/branches/py3k-struni/Mac/Modules/ctl/_Ctlmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/ctl/_Ctlmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/ctl/_Ctlmodule.c	Sun Jul 22 16:41:55 2007
@@ -135,7 +135,7 @@
 
 PyTypeObject Control_Type;
 
-#define CtlObj_Check(x) ((x)->ob_type == &Control_Type || PyObject_TypeCheck((x), &Control_Type))
+#define CtlObj_Check(x) (Py_Type(x) == &Control_Type || PyObject_TypeCheck((x), &Control_Type))
 
 typedef struct ControlObject {
 	PyObject_HEAD
@@ -170,7 +170,7 @@
 {
 	Py_XDECREF(self->ob_callbackdict);
 	if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CtlObj_HiliteControl(ControlObject *_self, PyObject *_args)
@@ -3865,8 +3865,7 @@
 
 
 PyTypeObject Control_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Ctl.Control", /*tp_name*/
 	sizeof(ControlObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -5791,7 +5790,7 @@
 	if (Ctl_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Ctl_Error) != 0)
 		return;
-	Control_Type.ob_type = &PyType_Type;
+	Py_Type(&Control_Type) = &PyType_Type;
 	if (PyType_Ready(&Control_Type) < 0) return;
 	Py_INCREF(&Control_Type);
 	PyModule_AddObject(m, "Control", (PyObject *)&Control_Type);

Modified: python/branches/py3k-struni/Mac/Modules/dlg/_Dlgmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/dlg/_Dlgmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/dlg/_Dlgmodule.c	Sun Jul 22 16:41:55 2007
@@ -129,7 +129,7 @@
 
 PyTypeObject Dialog_Type;
 
-#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type || PyObject_TypeCheck((x), &Dialog_Type))
+#define DlgObj_Check(x) (Py_Type(x) == &Dialog_Type || PyObject_TypeCheck((x), &Dialog_Type))
 
 typedef struct DialogObject {
 	PyObject_HEAD
@@ -164,7 +164,7 @@
 static void DlgObj_dealloc(DialogObject *self)
 {
 	DisposeDialog(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *DlgObj_DrawDialog(DialogObject *_self, PyObject *_args)
@@ -975,8 +975,7 @@
 
 
 PyTypeObject Dialog_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Dlg.Dialog", /*tp_name*/
 	sizeof(DialogObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1583,7 +1582,7 @@
 	if (Dlg_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Dlg_Error) != 0)
 		return;
-	Dialog_Type.ob_type = &PyType_Type;
+	Py_Type(&Dialog_Type) = &PyType_Type;
 	if (PyType_Ready(&Dialog_Type) < 0) return;
 	Py_INCREF(&Dialog_Type);
 	PyModule_AddObject(m, "Dialog", (PyObject *)&Dialog_Type);

Modified: python/branches/py3k-struni/Mac/Modules/drag/_Dragmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/drag/_Dragmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/drag/_Dragmodule.c	Sun Jul 22 16:41:55 2007
@@ -40,7 +40,7 @@
 
 PyTypeObject DragObj_Type;
 
-#define DragObj_Check(x) ((x)->ob_type == &DragObj_Type || PyObject_TypeCheck((x), &DragObj_Type))
+#define DragObj_Check(x) (Py_Type(x) == &DragObj_Type || PyObject_TypeCheck((x), &DragObj_Type))
 
 typedef struct DragObjObject {
 	PyObject_HEAD
@@ -76,7 +76,7 @@
 static void DragObj_dealloc(DragObjObject *self)
 {
 	Py_XDECREF(self->sendproc);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *DragObj_DisposeDrag(DragObjObject *_self, PyObject *_args)
@@ -760,8 +760,7 @@
 
 
 PyTypeObject DragObj_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Drag.DragObj", /*tp_name*/
 	sizeof(DragObjObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1126,7 +1125,7 @@
 	if (Drag_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Drag_Error) != 0)
 		return;
-	DragObj_Type.ob_type = &PyType_Type;
+	Py_Type(&DragObj_Type) = &PyType_Type;
 	if (PyType_Ready(&DragObj_Type) < 0) return;
 	Py_INCREF(&DragObj_Type);
 	PyModule_AddObject(m, "DragObj", (PyObject *)&DragObj_Type);

Modified: python/branches/py3k-struni/Mac/Modules/file/_Filemodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/file/_Filemodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/file/_Filemodule.c	Sun Jul 22 16:41:55 2007
@@ -143,7 +143,7 @@
 
 static PyTypeObject FSCatalogInfo_Type;
 
-#define FSCatalogInfo_Check(x) ((x)->ob_type == &FSCatalogInfo_Type || PyObject_TypeCheck((x), &FSCatalogInfo_Type))
+#define FSCatalogInfo_Check(x) (Py_Type(x) == &FSCatalogInfo_Type || PyObject_TypeCheck((x), &FSCatalogInfo_Type))
 
 typedef struct FSCatalogInfoObject {
 	PyObject_HEAD
@@ -174,7 +174,7 @@
 static void FSCatalogInfo_dealloc(FSCatalogInfoObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef FSCatalogInfo_methods[] = {
@@ -453,8 +453,7 @@
 
 
 static PyTypeObject FSCatalogInfo_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"Carbon.File.FSCatalogInfo", /*tp_name*/
 	sizeof(FSCatalogInfoObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -503,7 +502,7 @@
 
 static PyTypeObject FInfo_Type;
 
-#define FInfo_Check(x) ((x)->ob_type == &FInfo_Type || PyObject_TypeCheck((x), &FInfo_Type))
+#define FInfo_Check(x) (Py_Type(x) == &FInfo_Type || PyObject_TypeCheck((x), &FInfo_Type))
 
 typedef struct FInfoObject {
 	PyObject_HEAD
@@ -534,7 +533,7 @@
 static void FInfo_dealloc(FInfoObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef FInfo_methods[] = {
@@ -639,8 +638,7 @@
 
 
 static PyTypeObject FInfo_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"Carbon.File.FInfo", /*tp_name*/
 	sizeof(FInfoObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -689,7 +687,7 @@
 
 static PyTypeObject Alias_Type;
 
-#define Alias_Check(x) ((x)->ob_type == &Alias_Type || PyObject_TypeCheck((x), &Alias_Type))
+#define Alias_Check(x) (Py_Type(x) == &Alias_Type || PyObject_TypeCheck((x), &Alias_Type))
 
 typedef struct AliasObject {
 	PyObject_HEAD
@@ -726,7 +724,7 @@
 		self->ob_freeit(self->ob_itself);
 	}
 	self->ob_itself = NULL;
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args)
@@ -986,8 +984,7 @@
 
 
 static PyTypeObject Alias_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"Carbon.File.Alias", /*tp_name*/
 	sizeof(AliasObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1056,7 +1053,7 @@
 static void FSSpec_dealloc(FSSpecObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *FSSpec_FSpOpenDF(FSSpecObject *_self, PyObject *_args)
@@ -1389,7 +1386,7 @@
 {
 	char buf[512];
 	PyOS_snprintf(buf, sizeof(buf), "%s((%d, %ld, '%.*s'))",
-	        self->ob_type->tp_name,
+	        Py_Type(self)->tp_name,
 	        self->ob_itself.vRefNum,
 	        self->ob_itself.parID,
 	        self->ob_itself.name[0], self->ob_itself.name+1);
@@ -1445,8 +1442,7 @@
 
 
 static PyTypeObject FSSpec_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"Carbon.File.FSSpec", /*tp_name*/
 	sizeof(FSSpecObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1515,7 +1511,7 @@
 static void FSRef_dealloc(FSRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *FSRef_FSMakeFSRefUnicode(FSRefObject *_self, PyObject *_args)
@@ -1989,8 +1985,7 @@
 
 
 static PyTypeObject FSRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"Carbon.File.FSRef", /*tp_name*/
 	sizeof(FSRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -3255,35 +3250,35 @@
 	if (File_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", File_Error) != 0)
 		return;
-	FSCatalogInfo_Type.ob_type = &PyType_Type;
+	Py_Type(&FSCatalogInfo_Type) = &PyType_Type;
 	if (PyType_Ready(&FSCatalogInfo_Type) < 0) return;
 	Py_INCREF(&FSCatalogInfo_Type);
 	PyModule_AddObject(m, "FSCatalogInfo", (PyObject *)&FSCatalogInfo_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&FSCatalogInfo_Type);
 	PyModule_AddObject(m, "FSCatalogInfoType", (PyObject *)&FSCatalogInfo_Type);
-	FInfo_Type.ob_type = &PyType_Type;
+	Py_Type(&FInfo_Type) = &PyType_Type;
 	if (PyType_Ready(&FInfo_Type) < 0) return;
 	Py_INCREF(&FInfo_Type);
 	PyModule_AddObject(m, "FInfo", (PyObject *)&FInfo_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&FInfo_Type);
 	PyModule_AddObject(m, "FInfoType", (PyObject *)&FInfo_Type);
-	Alias_Type.ob_type = &PyType_Type;
+	Py_Type(&Alias_Type) = &PyType_Type;
 	if (PyType_Ready(&Alias_Type) < 0) return;
 	Py_INCREF(&Alias_Type);
 	PyModule_AddObject(m, "Alias", (PyObject *)&Alias_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Alias_Type);
 	PyModule_AddObject(m, "AliasType", (PyObject *)&Alias_Type);
-	FSSpec_Type.ob_type = &PyType_Type;
+	Py_Type(&FSSpec_Type) = &PyType_Type;
 	if (PyType_Ready(&FSSpec_Type) < 0) return;
 	Py_INCREF(&FSSpec_Type);
 	PyModule_AddObject(m, "FSSpec", (PyObject *)&FSSpec_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&FSSpec_Type);
 	PyModule_AddObject(m, "FSSpecType", (PyObject *)&FSSpec_Type);
-	FSRef_Type.ob_type = &PyType_Type;
+	Py_Type(&FSRef_Type) = &PyType_Type;
 	if (PyType_Ready(&FSRef_Type) < 0) return;
 	Py_INCREF(&FSRef_Type);
 	PyModule_AddObject(m, "FSRef", (PyObject *)&FSRef_Type);

Modified: python/branches/py3k-struni/Mac/Modules/ibcarbon/_IBCarbon.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/ibcarbon/_IBCarbon.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/ibcarbon/_IBCarbon.c	Sun Jul 22 16:41:55 2007
@@ -19,7 +19,7 @@
 
 PyTypeObject IBNibRef_Type;
 
-#define IBNibRefObj_Check(x) ((x)->ob_type == &IBNibRef_Type || PyObject_TypeCheck((x), &IBNibRef_Type))
+#define IBNibRefObj_Check(x) (Py_Type(x) == &IBNibRef_Type || PyObject_TypeCheck((x), &IBNibRef_Type))
 
 typedef struct IBNibRefObject {
 	PyObject_HEAD
@@ -49,7 +49,7 @@
 static void IBNibRefObj_dealloc(IBNibRefObject *self)
 {
 	DisposeNibReference(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *IBNibRefObj_CreateWindowFromNib(IBNibRefObject *_self, PyObject *_args)
@@ -162,8 +162,7 @@
 
 
 PyTypeObject IBNibRef_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_IBCarbon.IBNibRef", /*tp_name*/
 	sizeof(IBNibRefObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -249,7 +248,7 @@
 	if (IBCarbon_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", IBCarbon_Error) != 0)
 		return;
-	IBNibRef_Type.ob_type = &PyType_Type;
+	Py_Type(&IBNibRef_Type) = &PyType_Type;
 	if (PyType_Ready(&IBNibRef_Type) < 0) return;
 	Py_INCREF(&IBNibRef_Type);
 	PyModule_AddObject(m, "IBNibRef", (PyObject *)&IBNibRef_Type);

Modified: python/branches/py3k-struni/Mac/Modules/list/_Listmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/list/_Listmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/list/_Listmodule.c	Sun Jul 22 16:41:55 2007
@@ -37,7 +37,7 @@
 
 PyTypeObject List_Type;
 
-#define ListObj_Check(x) ((x)->ob_type == &List_Type || PyObject_TypeCheck((x), &List_Type))
+#define ListObj_Check(x) (Py_Type(x) == &List_Type || PyObject_TypeCheck((x), &List_Type))
 
 typedef struct ListObject {
 	PyObject_HEAD
@@ -79,7 +79,7 @@
 	self->ob_ldef_func = NULL;
 	SetListRefCon(self->ob_itself, (long)0);
 	if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ListObj_LAddColumn(ListObject *_self, PyObject *_args)
@@ -755,8 +755,7 @@
 
 
 PyTypeObject List_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_List.List", /*tp_name*/
 	sizeof(ListObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1117,7 +1116,7 @@
 	if (List_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", List_Error) != 0)
 		return;
-	List_Type.ob_type = &PyType_Type;
+	Py_Type(&List_Type) = &PyType_Type;
 	if (PyType_Ready(&List_Type) < 0) return;
 	Py_INCREF(&List_Type);
 	PyModule_AddObject(m, "List", (PyObject *)&List_Type);

Modified: python/branches/py3k-struni/Mac/Modules/menu/_Menumodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/menu/_Menumodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/menu/_Menumodule.c	Sun Jul 22 16:41:55 2007
@@ -57,7 +57,7 @@
 
 PyTypeObject Menu_Type;
 
-#define MenuObj_Check(x) ((x)->ob_type == &Menu_Type || PyObject_TypeCheck((x), &Menu_Type))
+#define MenuObj_Check(x) (Py_Type(x) == &Menu_Type || PyObject_TypeCheck((x), &Menu_Type))
 
 typedef struct MenuObject {
 	PyObject_HEAD
@@ -87,7 +87,7 @@
 static void MenuObj_dealloc(MenuObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MenuObj_DisposeMenu(MenuObject *_self, PyObject *_args)
@@ -2553,8 +2553,7 @@
 
 
 PyTypeObject Menu_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Menu.Menu", /*tp_name*/
 	sizeof(MenuObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -3456,7 +3455,7 @@
 	if (Menu_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Menu_Error) != 0)
 		return;
-	Menu_Type.ob_type = &PyType_Type;
+	Py_Type(&Menu_Type) = &PyType_Type;
 	if (PyType_Ready(&Menu_Type) < 0) return;
 	Py_INCREF(&Menu_Type);
 	PyModule_AddObject(m, "Menu", (PyObject *)&Menu_Type);

Modified: python/branches/py3k-struni/Mac/Modules/mlte/_Mltemodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/mlte/_Mltemodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/mlte/_Mltemodule.c	Sun Jul 22 16:41:55 2007
@@ -69,7 +69,7 @@
 
 PyTypeObject TXNObject_Type;
 
-#define TXNObj_Check(x) ((x)->ob_type == &TXNObject_Type || PyObject_TypeCheck((x), &TXNObject_Type))
+#define TXNObj_Check(x) (Py_Type(x) == &TXNObject_Type || PyObject_TypeCheck((x), &TXNObject_Type))
 
 typedef struct TXNObjectObject {
 	PyObject_HEAD
@@ -100,7 +100,7 @@
 static void TXNObj_dealloc(TXNObjectObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TXNObj_TXNDeleteObject(TXNObjectObject *_self, PyObject *_args)
@@ -1255,8 +1255,7 @@
 
 
 PyTypeObject TXNObject_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Mlte.TXNObject", /*tp_name*/
 	sizeof(TXNObjectObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1305,7 +1304,7 @@
 
 PyTypeObject TXNFontMenuObject_Type;
 
-#define TXNFontMenuObj_Check(x) ((x)->ob_type == &TXNFontMenuObject_Type || PyObject_TypeCheck((x), &TXNFontMenuObject_Type))
+#define TXNFontMenuObj_Check(x) (Py_Type(x) == &TXNFontMenuObject_Type || PyObject_TypeCheck((x), &TXNFontMenuObject_Type))
 
 typedef struct TXNFontMenuObjectObject {
 	PyObject_HEAD
@@ -1336,7 +1335,7 @@
 static void TXNFontMenuObj_dealloc(TXNFontMenuObjectObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TXNFontMenuObj_TXNGetFontMenuHandle(TXNFontMenuObjectObject *_self, PyObject *_args)
@@ -1409,8 +1408,7 @@
 
 
 PyTypeObject TXNFontMenuObject_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Mlte.TXNFontMenuObject", /*tp_name*/
 	sizeof(TXNFontMenuObjectObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1661,14 +1659,14 @@
 	if (Mlte_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Mlte_Error) != 0)
 		return;
-	TXNObject_Type.ob_type = &PyType_Type;
+	Py_Type(&TXNObject_Type) = &PyType_Type;
 	if (PyType_Ready(&TXNObject_Type) < 0) return;
 	Py_INCREF(&TXNObject_Type);
 	PyModule_AddObject(m, "TXNObject", (PyObject *)&TXNObject_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&TXNObject_Type);
 	PyModule_AddObject(m, "TXNObjectType", (PyObject *)&TXNObject_Type);
-	TXNFontMenuObject_Type.ob_type = &PyType_Type;
+	Py_Type(&TXNFontMenuObject_Type) = &PyType_Type;
 	if (PyType_Ready(&TXNFontMenuObject_Type) < 0) return;
 	Py_INCREF(&TXNFontMenuObject_Type);
 	PyModule_AddObject(m, "TXNFontMenuObject", (PyObject *)&TXNFontMenuObject_Type);

Modified: python/branches/py3k-struni/Mac/Modules/osa/_OSAmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/osa/_OSAmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/osa/_OSAmodule.c	Sun Jul 22 16:41:55 2007
@@ -34,7 +34,7 @@
 
 PyTypeObject OSAComponentInstance_Type;
 
-#define OSAObj_Check(x) ((x)->ob_type == &OSAComponentInstance_Type || PyObject_TypeCheck((x), &OSAComponentInstance_Type))
+#define OSAObj_Check(x) (Py_Type(x) == &OSAComponentInstance_Type || PyObject_TypeCheck((x), &OSAComponentInstance_Type))
 
 typedef struct OSAComponentInstanceObject {
 	PyObject_HEAD
@@ -73,7 +73,7 @@
 static void OSAObj_dealloc(OSAComponentInstanceObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *OSAObj_OSALoad(OSAComponentInstanceObject *_self, PyObject *_args)
@@ -1150,8 +1150,7 @@
 
 
 PyTypeObject OSAComponentInstance_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_OSA.OSAComponentInstance", /*tp_name*/
 	sizeof(OSAComponentInstanceObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1222,7 +1221,7 @@
 	if (OSA_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", OSA_Error) != 0)
 		return;
-	OSAComponentInstance_Type.ob_type = &PyType_Type;
+	Py_Type(&OSAComponentInstance_Type) = &PyType_Type;
 	if (PyType_Ready(&OSAComponentInstance_Type) < 0) return;
 	Py_INCREF(&OSAComponentInstance_Type);
 	PyModule_AddObject(m, "OSAComponentInstance", (PyObject *)&OSAComponentInstance_Type);

Modified: python/branches/py3k-struni/Mac/Modules/qd/_Qdmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/qd/_Qdmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/qd/_Qdmodule.c	Sun Jul 22 16:41:55 2007
@@ -73,7 +73,7 @@
 
 PyTypeObject GrafPort_Type;
 
-#define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type))
+#define GrafObj_Check(x) (Py_Type(x) == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type))
 
 typedef struct GrafPortObject {
 	PyObject_HEAD
@@ -125,7 +125,7 @@
 static void GrafObj_dealloc(GrafPortObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *GrafObj_MacSetPort(GrafPortObject *_self, PyObject *_args)
@@ -1358,8 +1358,7 @@
 
 
 PyTypeObject GrafPort_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qd.GrafPort", /*tp_name*/
 	sizeof(GrafPortObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1408,7 +1407,7 @@
 
 PyTypeObject BitMap_Type;
 
-#define BMObj_Check(x) ((x)->ob_type == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type))
+#define BMObj_Check(x) (Py_Type(x) == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type))
 
 typedef struct BitMapObject {
 	PyObject_HEAD
@@ -1444,7 +1443,7 @@
 {
 	Py_XDECREF(self->referred_object);
 	if (self->referred_bitmap) free(self->referred_bitmap);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *BMObj_getdata(BitMapObject *_self, PyObject *_args)
@@ -1557,8 +1556,7 @@
 
 
 PyTypeObject BitMap_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qd.BitMap", /*tp_name*/
 	sizeof(BitMapObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -7124,14 +7122,14 @@
 	if (Qd_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Qd_Error) != 0)
 		return;
-	GrafPort_Type.ob_type = &PyType_Type;
+	Py_Type(&GrafPort_Type) = &PyType_Type;
 	if (PyType_Ready(&GrafPort_Type) < 0) return;
 	Py_INCREF(&GrafPort_Type);
 	PyModule_AddObject(m, "GrafPort", (PyObject *)&GrafPort_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&GrafPort_Type);
 	PyModule_AddObject(m, "GrafPortType", (PyObject *)&GrafPort_Type);
-	BitMap_Type.ob_type = &PyType_Type;
+	Py_Type(&BitMap_Type) = &PyType_Type;
 	if (PyType_Ready(&BitMap_Type) < 0) return;
 	Py_INCREF(&BitMap_Type);
 	PyModule_AddObject(m, "BitMap", (PyObject *)&BitMap_Type);

Modified: python/branches/py3k-struni/Mac/Modules/qdoffs/_Qdoffsmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/qdoffs/_Qdoffsmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/qdoffs/_Qdoffsmodule.c	Sun Jul 22 16:41:55 2007
@@ -34,7 +34,7 @@
 
 PyTypeObject GWorld_Type;
 
-#define GWorldObj_Check(x) ((x)->ob_type == &GWorld_Type || PyObject_TypeCheck((x), &GWorld_Type))
+#define GWorldObj_Check(x) (Py_Type(x) == &GWorld_Type || PyObject_TypeCheck((x), &GWorld_Type))
 
 typedef struct GWorldObject {
 	PyObject_HEAD
@@ -65,7 +65,7 @@
 static void GWorldObj_dealloc(GWorldObject *self)
 {
 	DisposeGWorld(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args)
@@ -151,8 +151,7 @@
 
 
 PyTypeObject GWorld_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qdoffs.GWorld", /*tp_name*/
 	sizeof(GWorldObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -701,7 +700,7 @@
 	if (Qdoffs_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Qdoffs_Error) != 0)
 		return;
-	GWorld_Type.ob_type = &PyType_Type;
+	Py_Type(&GWorld_Type) = &PyType_Type;
 	if (PyType_Ready(&GWorld_Type) < 0) return;
 	Py_INCREF(&GWorld_Type);
 	PyModule_AddObject(m, "GWorld", (PyObject *)&GWorld_Type);

Modified: python/branches/py3k-struni/Mac/Modules/qt/_Qtmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/qt/_Qtmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/qt/_Qtmodule.c	Sun Jul 22 16:41:55 2007
@@ -97,7 +97,7 @@
 
 PyTypeObject IdleManager_Type;
 
-#define IdleManagerObj_Check(x) ((x)->ob_type == &IdleManager_Type || PyObject_TypeCheck((x), &IdleManager_Type))
+#define IdleManagerObj_Check(x) (Py_Type(x) == &IdleManager_Type || PyObject_TypeCheck((x), &IdleManager_Type))
 
 typedef struct IdleManagerObject {
 	PyObject_HEAD
@@ -136,7 +136,7 @@
 static void IdleManagerObj_dealloc(IdleManagerObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef IdleManagerObj_methods[] = {
@@ -171,8 +171,7 @@
 
 
 PyTypeObject IdleManager_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.IdleManager", /*tp_name*/
 	sizeof(IdleManagerObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -221,7 +220,7 @@
 
 PyTypeObject MovieController_Type;
 
-#define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type || PyObject_TypeCheck((x), &MovieController_Type))
+#define MovieCtlObj_Check(x) (Py_Type(x) == &MovieController_Type || PyObject_TypeCheck((x), &MovieController_Type))
 
 typedef struct MovieControllerObject {
 	PyObject_HEAD
@@ -260,7 +259,7 @@
 static void MovieCtlObj_dealloc(MovieControllerObject *self)
 {
 	if (self->ob_itself) DisposeMovieController(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MovieCtlObj_MCSetMovie(MovieControllerObject *_self, PyObject *_args)
@@ -1291,8 +1290,7 @@
 
 
 PyTypeObject MovieController_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.MovieController", /*tp_name*/
 	sizeof(MovieControllerObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1341,7 +1339,7 @@
 
 PyTypeObject TimeBase_Type;
 
-#define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type || PyObject_TypeCheck((x), &TimeBase_Type))
+#define TimeBaseObj_Check(x) (Py_Type(x) == &TimeBase_Type || PyObject_TypeCheck((x), &TimeBase_Type))
 
 typedef struct TimeBaseObject {
 	PyObject_HEAD
@@ -1380,7 +1378,7 @@
 static void TimeBaseObj_dealloc(TimeBaseObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TimeBaseObj_DisposeTimeBase(TimeBaseObject *_self, PyObject *_args)
@@ -1785,8 +1783,7 @@
 
 
 PyTypeObject TimeBase_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.TimeBase", /*tp_name*/
 	sizeof(TimeBaseObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1835,7 +1832,7 @@
 
 PyTypeObject UserData_Type;
 
-#define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type || PyObject_TypeCheck((x), &UserData_Type))
+#define UserDataObj_Check(x) (Py_Type(x) == &UserData_Type || PyObject_TypeCheck((x), &UserData_Type))
 
 typedef struct UserDataObject {
 	PyObject_HEAD
@@ -1874,7 +1871,7 @@
 static void UserDataObj_dealloc(UserDataObject *self)
 {
 	if (self->ob_itself) DisposeUserData(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *UserDataObj_GetUserData(UserDataObject *_self, PyObject *_args)
@@ -2156,8 +2153,7 @@
 
 
 PyTypeObject UserData_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.UserData", /*tp_name*/
 	sizeof(UserDataObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -2206,7 +2202,7 @@
 
 PyTypeObject Media_Type;
 
-#define MediaObj_Check(x) ((x)->ob_type == &Media_Type || PyObject_TypeCheck((x), &Media_Type))
+#define MediaObj_Check(x) (Py_Type(x) == &Media_Type || PyObject_TypeCheck((x), &Media_Type))
 
 typedef struct MediaObject {
 	PyObject_HEAD
@@ -2245,7 +2241,7 @@
 static void MediaObj_dealloc(MediaObject *self)
 {
 	if (self->ob_itself) DisposeTrackMedia(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MediaObj_LoadMediaIntoRam(MediaObject *_self, PyObject *_args)
@@ -3398,8 +3394,7 @@
 
 
 PyTypeObject Media_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.Media", /*tp_name*/
 	sizeof(MediaObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -3448,7 +3443,7 @@
 
 PyTypeObject Track_Type;
 
-#define TrackObj_Check(x) ((x)->ob_type == &Track_Type || PyObject_TypeCheck((x), &Track_Type))
+#define TrackObj_Check(x) (Py_Type(x) == &Track_Type || PyObject_TypeCheck((x), &Track_Type))
 
 typedef struct TrackObject {
 	PyObject_HEAD
@@ -3487,7 +3482,7 @@
 static void TrackObj_dealloc(TrackObject *self)
 {
 	if (self->ob_itself) DisposeMovieTrack(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TrackObj_LoadTrackIntoRam(TrackObject *_self, PyObject *_args)
@@ -4746,8 +4741,7 @@
 
 
 PyTypeObject Track_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.Track", /*tp_name*/
 	sizeof(TrackObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -4796,7 +4790,7 @@
 
 PyTypeObject Movie_Type;
 
-#define MovieObj_Check(x) ((x)->ob_type == &Movie_Type || PyObject_TypeCheck((x), &Movie_Type))
+#define MovieObj_Check(x) (Py_Type(x) == &Movie_Type || PyObject_TypeCheck((x), &Movie_Type))
 
 typedef struct MovieObject {
 	PyObject_HEAD
@@ -4835,7 +4829,7 @@
 static void MovieObj_dealloc(MovieObject *self)
 {
 	if (self->ob_itself) DisposeMovie(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MovieObj_MoviesTask(MovieObject *_self, PyObject *_args)
@@ -7299,8 +7293,7 @@
 
 
 PyTypeObject Movie_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.Movie", /*tp_name*/
 	sizeof(MovieObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -7349,7 +7342,7 @@
 
 PyTypeObject SGOutput_Type;
 
-#define SGOutputObj_Check(x) ((x)->ob_type == &SGOutput_Type || PyObject_TypeCheck((x), &SGOutput_Type))
+#define SGOutputObj_Check(x) (Py_Type(x) == &SGOutput_Type || PyObject_TypeCheck((x), &SGOutput_Type))
 
 typedef struct SGOutputObject {
 	PyObject_HEAD
@@ -7388,7 +7381,7 @@
 static void SGOutputObj_dealloc(SGOutputObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef SGOutputObj_methods[] = {
@@ -7423,8 +7416,7 @@
 
 
 PyTypeObject SGOutput_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Qt.SGOutput", /*tp_name*/
 	sizeof(SGOutputObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -28021,56 +28013,56 @@
 	if (Qt_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Qt_Error) != 0)
 		return;
-	IdleManager_Type.ob_type = &PyType_Type;
+	Py_Type(&IdleManager_Type) = &PyType_Type;
 	if (PyType_Ready(&IdleManager_Type) < 0) return;
 	Py_INCREF(&IdleManager_Type);
 	PyModule_AddObject(m, "IdleManager", (PyObject *)&IdleManager_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&IdleManager_Type);
 	PyModule_AddObject(m, "IdleManagerType", (PyObject *)&IdleManager_Type);
-	MovieController_Type.ob_type = &PyType_Type;
+	Py_Type(&MovieController_Type) = &PyType_Type;
 	if (PyType_Ready(&MovieController_Type) < 0) return;
 	Py_INCREF(&MovieController_Type);
 	PyModule_AddObject(m, "MovieController", (PyObject *)&MovieController_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&MovieController_Type);
 	PyModule_AddObject(m, "MovieControllerType", (PyObject *)&MovieController_Type);
-	TimeBase_Type.ob_type = &PyType_Type;
+	Py_Type(&TimeBase_Type) = &PyType_Type;
 	if (PyType_Ready(&TimeBase_Type) < 0) return;
 	Py_INCREF(&TimeBase_Type);
 	PyModule_AddObject(m, "TimeBase", (PyObject *)&TimeBase_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&TimeBase_Type);
 	PyModule_AddObject(m, "TimeBaseType", (PyObject *)&TimeBase_Type);
-	UserData_Type.ob_type = &PyType_Type;
+	Py_Type(&UserData_Type) = &PyType_Type;
 	if (PyType_Ready(&UserData_Type) < 0) return;
 	Py_INCREF(&UserData_Type);
 	PyModule_AddObject(m, "UserData", (PyObject *)&UserData_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&UserData_Type);
 	PyModule_AddObject(m, "UserDataType", (PyObject *)&UserData_Type);
-	Media_Type.ob_type = &PyType_Type;
+	Py_Type(&Media_Type) = &PyType_Type;
 	if (PyType_Ready(&Media_Type) < 0) return;
 	Py_INCREF(&Media_Type);
 	PyModule_AddObject(m, "Media", (PyObject *)&Media_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Media_Type);
 	PyModule_AddObject(m, "MediaType", (PyObject *)&Media_Type);
-	Track_Type.ob_type = &PyType_Type;
+	Py_Type(&Track_Type) = &PyType_Type;
 	if (PyType_Ready(&Track_Type) < 0) return;
 	Py_INCREF(&Track_Type);
 	PyModule_AddObject(m, "Track", (PyObject *)&Track_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Track_Type);
 	PyModule_AddObject(m, "TrackType", (PyObject *)&Track_Type);
-	Movie_Type.ob_type = &PyType_Type;
+	Py_Type(&Movie_Type) = &PyType_Type;
 	if (PyType_Ready(&Movie_Type) < 0) return;
 	Py_INCREF(&Movie_Type);
 	PyModule_AddObject(m, "Movie", (PyObject *)&Movie_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Movie_Type);
 	PyModule_AddObject(m, "MovieType", (PyObject *)&Movie_Type);
-	SGOutput_Type.ob_type = &PyType_Type;
+	Py_Type(&SGOutput_Type) = &PyType_Type;
 	if (PyType_Ready(&SGOutput_Type) < 0) return;
 	Py_INCREF(&SGOutput_Type);
 	PyModule_AddObject(m, "SGOutput", (PyObject *)&SGOutput_Type);

Modified: python/branches/py3k-struni/Mac/Modules/res/_Resmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/res/_Resmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/res/_Resmodule.c	Sun Jul 22 16:41:55 2007
@@ -41,7 +41,7 @@
 
 PyTypeObject Resource_Type;
 
-#define ResObj_Check(x) ((x)->ob_type == &Resource_Type || PyObject_TypeCheck((x), &Resource_Type))
+#define ResObj_Check(x) (Py_Type(x) == &Resource_Type || PyObject_TypeCheck((x), &Resource_Type))
 
 typedef struct ResourceObject {
 	PyObject_HEAD
@@ -89,7 +89,7 @@
 		self->ob_freeit(self->ob_itself);
 	}
 	self->ob_itself = NULL;
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ResObj_HomeResFile(ResourceObject *_self, PyObject *_args)
@@ -617,8 +617,7 @@
 
 
 PyTypeObject Resource_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Res.Resource", /*tp_name*/
 	sizeof(ResourceObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1731,7 +1730,7 @@
 	if (Res_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Res_Error) != 0)
 		return;
-	Resource_Type.ob_type = &PyType_Type;
+	Py_Type(&Resource_Type) = &PyType_Type;
 	if (PyType_Ready(&Resource_Type) < 0) return;
 	Py_INCREF(&Resource_Type);
 	PyModule_AddObject(m, "Resource", (PyObject *)&Resource_Type);

Modified: python/branches/py3k-struni/Mac/Modules/scrap/_Scrapmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/scrap/_Scrapmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/scrap/_Scrapmodule.c	Sun Jul 22 16:41:55 2007
@@ -23,7 +23,7 @@
 
 PyTypeObject Scrap_Type;
 
-#define ScrapObj_Check(x) ((x)->ob_type == &Scrap_Type || PyObject_TypeCheck((x), &Scrap_Type))
+#define ScrapObj_Check(x) (Py_Type(x) == &Scrap_Type || PyObject_TypeCheck((x), &Scrap_Type))
 
 typedef struct ScrapObject {
 	PyObject_HEAD
@@ -52,7 +52,7 @@
 static void ScrapObj_dealloc(ScrapObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ScrapObj_GetScrapFlavorFlags(ScrapObject *_self, PyObject *_args)
@@ -230,8 +230,7 @@
 #define ScrapObj_hash NULL
 
 PyTypeObject Scrap_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Scrap.Scrap", /*tp_name*/
 	sizeof(ScrapObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -347,7 +346,7 @@
 	if (Scrap_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Scrap_Error) != 0)
 		return;
-	Scrap_Type.ob_type = &PyType_Type;
+	Py_Type(&Scrap_Type) = &PyType_Type;
 	Py_INCREF(&Scrap_Type);
 	if (PyDict_SetItemString(d, "ScrapType", (PyObject *)&Scrap_Type) != 0)
 		Py_FatalError("can't initialize ScrapType");

Modified: python/branches/py3k-struni/Mac/Modules/snd/_Sndmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/snd/_Sndmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/snd/_Sndmodule.c	Sun Jul 22 16:41:55 2007
@@ -42,7 +42,7 @@
 
 static PyTypeObject SndChannel_Type;
 
-#define SndCh_Check(x) ((x)->ob_type == &SndChannel_Type || PyObject_TypeCheck((x), &SndChannel_Type))
+#define SndCh_Check(x) (Py_Type(x) == &SndChannel_Type || PyObject_TypeCheck((x), &SndChannel_Type))
 
 typedef struct SndChannelObject {
 	PyObject_HEAD
@@ -207,8 +207,7 @@
 #define SndCh_hash NULL
 
 static PyTypeObject SndChannel_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Snd.SndChannel", /*tp_name*/
 	sizeof(SndChannelObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -257,7 +256,7 @@
 
 static PyTypeObject SPB_Type;
 
-#define SPBObj_Check(x) ((x)->ob_type == &SPB_Type || PyObject_TypeCheck((x), &SPB_Type))
+#define SPBObj_Check(x) (Py_Type(x) == &SPB_Type || PyObject_TypeCheck((x), &SPB_Type))
 
 typedef struct SPBObject {
 	PyObject_HEAD
@@ -375,8 +374,7 @@
 #define SPBObj_hash NULL
 
 static PyTypeObject SPB_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Snd.SPB", /*tp_name*/
 	sizeof(SPBObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1131,14 +1129,14 @@
 	if (Snd_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Snd_Error) != 0)
 		return;
-	SndChannel_Type.ob_type = &PyType_Type;
+	Py_Type(&SndChannel_Type) = &PyType_Type;
 	if (PyType_Ready(&SndChannel_Type) < 0) return;
 	Py_INCREF(&SndChannel_Type);
 	PyModule_AddObject(m, "SndChannel", (PyObject *)&SndChannel_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&SndChannel_Type);
 	PyModule_AddObject(m, "SndChannelType", (PyObject *)&SndChannel_Type);
-	SPB_Type.ob_type = &PyType_Type;
+	Py_Type(&SPB_Type) = &PyType_Type;
 	if (PyType_Ready(&SPB_Type) < 0) return;
 	Py_INCREF(&SPB_Type);
 	PyModule_AddObject(m, "SPB", (PyObject *)&SPB_Type);

Modified: python/branches/py3k-struni/Mac/Modules/te/_TEmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/te/_TEmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/te/_TEmodule.c	Sun Jul 22 16:41:55 2007
@@ -58,7 +58,7 @@
 
 PyTypeObject TE_Type;
 
-#define TEObj_Check(x) ((x)->ob_type == &TE_Type || PyObject_TypeCheck((x), &TE_Type))
+#define TEObj_Check(x) (Py_Type(x) == &TE_Type || PyObject_TypeCheck((x), &TE_Type))
 
 typedef struct TEObject {
 	PyObject_HEAD
@@ -92,7 +92,7 @@
 static void TEObj_dealloc(TEObject *self)
 {
 	TEDispose(self->ob_itself);
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TEObj_TESetText(TEObject *_self, PyObject *_args)
@@ -1000,8 +1000,7 @@
 
 
 PyTypeObject TE_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_TE.TE", /*tp_name*/
 	sizeof(TEObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -1318,7 +1317,7 @@
 	if (TE_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", TE_Error) != 0)
 		return;
-	TE_Type.ob_type = &PyType_Type;
+	Py_Type(&TE_Type) = &PyType_Type;
 	if (PyType_Ready(&TE_Type) < 0) return;
 	Py_INCREF(&TE_Type);
 	PyModule_AddObject(m, "TE", (PyObject *)&TE_Type);

Modified: python/branches/py3k-struni/Mac/Modules/win/_Winmodule.c
==============================================================================
--- python/branches/py3k-struni/Mac/Modules/win/_Winmodule.c	(original)
+++ python/branches/py3k-struni/Mac/Modules/win/_Winmodule.c	Sun Jul 22 16:41:55 2007
@@ -45,7 +45,7 @@
 
 PyTypeObject Window_Type;
 
-#define WinObj_Check(x) ((x)->ob_type == &Window_Type || PyObject_TypeCheck((x), &Window_Type))
+#define WinObj_Check(x) (Py_Type(x) == &Window_Type || PyObject_TypeCheck((x), &Window_Type))
 
 typedef struct WindowObject {
 	PyObject_HEAD
@@ -102,7 +102,7 @@
 	}
 	self->ob_itself = NULL;
 	self->ob_freeit = NULL;
-	self->ob_type->tp_free((PyObject *)self);
+	Py_Type(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *WinObj_GetWindowOwnerCount(WindowObject *_self, PyObject *_args)
@@ -2607,8 +2607,7 @@
 
 
 PyTypeObject Window_Type = {
-	PyObject_HEAD_INIT(NULL)
-	0, /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_Win.Window", /*tp_name*/
 	sizeof(WindowObject), /*tp_basicsize*/
 	0, /*tp_itemsize*/
@@ -3245,7 +3244,7 @@
 	if (Win_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Win_Error) != 0)
 		return;
-	Window_Type.ob_type = &PyType_Type;
+	Py_Type(&Window_Type) = &PyType_Type;
 	if (PyType_Ready(&Window_Type) < 0) return;
 	Py_INCREF(&Window_Type);
 	PyModule_AddObject(m, "Window", (PyObject *)&Window_Type);

Modified: python/branches/py3k-struni/PC/_subprocess.c
==============================================================================
--- python/branches/py3k-struni/PC/_subprocess.c	(original)
+++ python/branches/py3k-struni/PC/_subprocess.c	Sun Jul 22 16:41:55 2007
@@ -128,8 +128,7 @@
 static PyNumberMethods sp_handle_as_number;
 
 static PyTypeObject sp_handle_type = {
-	PyObject_HEAD_INIT(NULL)
-	0,				/*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_subprocess_handle", sizeof(sp_handle_object), 0,
 	(destructor) sp_handle_dealloc, /*tp_dealloc*/
 	0, /*tp_print*/
@@ -273,7 +272,7 @@
 		PyErr_Clear(); /* FIXME: propagate error? */
 		return NULL;
 	}
-	if (value->ob_type != &sp_handle_type)
+	if (Py_Type(&value) != &sp_handle_type)
 		ret = NULL;
 	else
 		ret = value->handle;
@@ -556,7 +555,7 @@
 	PyObject *m;
 
 	/* patch up object descriptors */
-	sp_handle_type.ob_type = &PyType_Type;
+	Py_Type(&sp_handle_type) = &PyType_Type;
 	sp_handle_as_number.nb_int = (unaryfunc) sp_handle_as_int;
 
 	m = Py_InitModule("_subprocess", sp_functions);

Modified: python/branches/py3k-struni/PC/_winreg.c
==============================================================================
--- python/branches/py3k-struni/PC/_winreg.c	(original)
+++ python/branches/py3k-struni/PC/_winreg.c	Sun Jul 22 16:41:55 2007
@@ -1450,7 +1450,7 @@
 	if (m == NULL)
 		return;
 	d = PyModule_GetDict(m);
-	PyHKEY_Type.ob_type = &PyType_Type;
+	Py_Type(&PyHKEY_Type) = &PyType_Type;
 	PyHKEY_Type.tp_doc = PyHKEY_doc;
 	Py_INCREF(&PyHKEY_Type);
 	if (PyDict_SetItemString(d, "HKEYType",


More information about the Python-3000-checkins mailing list