From a0e2422615c1826fdbe963f4116eb6b3edccb951 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 7 Mar 1996 16:16:54 +0000 Subject: A few missing casts (Richard Neitzel). Don't append Unix paths on a Mac (Jack Jansen). --- Tools/modulator/Templates/module_tail | 2 +- Tools/modulator/genmodule.py | 10 ++++++---- Tools/modulator/modulator.py | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Tools/modulator/Templates/module_tail b/Tools/modulator/Templates/module_tail index 6ee7645..59cc50b 100644 --- a/Tools/modulator/Templates/module_tail +++ b/Tools/modulator/Templates/module_tail @@ -3,7 +3,7 @@ static struct PyMethodDef $abbrev$_methods[] = { $methodlist$ - {NULL, NULL} /* sentinel */ + {NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */ }; diff --git a/Tools/modulator/genmodule.py b/Tools/modulator/genmodule.py index bdfe350..e5c69bf 100755 --- a/Tools/modulator/genmodule.py +++ b/Tools/modulator/genmodule.py @@ -81,8 +81,9 @@ class module(writer): for fn in self.methodlist: self.method = fn self.addcode('module_method', fp) - new_ml = new_ml + ('{"%s",\t%s_%s,\t1,\t%s_%s__doc__},\n' - %(fn, self.abbrev, fn, self.abbrev, fn)) + new_ml = new_ml + ( + '{"%s",\t(PyCFunction)%s_%s,\tMETH_VARARGS,\t%s_%s__doc__},\n' + %(fn, self.abbrev, fn, self.abbrev, fn)) self.methodlist = new_ml self.addcode('module_tail', fp) @@ -107,8 +108,9 @@ class object(writer): for fn in self.methodlist: self.method = fn self.addcode('object_method', fp) - new_ml = new_ml + ('{"%s",\t%s_%s,\t1,\t%s_%s__doc__},\n' - %(fn, self.abbrev, fn, self.abbrev, fn)) + new_ml = new_ml + ( + '{"%s",\t(PyCFunction)%s_%s,\tMETH_VARARGS,\t%s_%s__doc__},\n' + %(fn, self.abbrev, fn, self.abbrev, fn)) self.methodlist = new_ml self.addcode('object_mlist', fp) diff --git a/Tools/modulator/modulator.py b/Tools/modulator/modulator.py index dd1ade5..02ad80d 100755 --- a/Tools/modulator/modulator.py +++ b/Tools/modulator/modulator.py @@ -17,7 +17,8 @@ # import sys, os -sys.path.append(os.path.join(os.environ['HOME'], 'src/python/Tools/modulator')) +if os.name <> 'mac': + sys.path.append(os.path.join(os.environ['HOME'], 'src/python/Tools/modulator')) from Tkinter import * from Tkextra import * -- cgit v0.12