[Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime

Nicholas Riley njriley at uiuc.edu
Mon Sep 6 16:15:47 CEST 2004


On Mon, Sep 06, 2004 at 02:48:20PM +0200, hinsen at cnrs-orleans.fr wrote:
> On Sep 5, 2004, at 16:19, Bob Ippolito wrote:
> I would have to do it through Tkinter, but I couldn't find anything of 
> use there. Perhaps the TclTkAqua people would be the ones to ask... 
> I'll report if I find something.

>>> import Tkinter
>>> foo = Tkinter.Toplevel()
>>> foo.winfo_server()
'QD10R30 Apple 1035'

for Aqua, or you'd get back "X11..." for X11.

Unfortunately, at least in the TkAqua 8.4.1 I have on my desktop G4,
winfo_server (and the corresponding Tcl, 'winfo server') causes the
process to crash:

% wish
% toplevel foo
% winfo server .foo
wish: line 2: 25264 Segmentation fault      "$(dirname $0)/../../Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell" "$@"

0   libSystem.B.dylib			    0x90006e70 strlen + 0x50
1   com.tcltk.tcllibrary		    0x0a060240 Tcl_AppendResultVA + 0xec
2   com.tcltk.tcllibrary		    0x0a060330 Tcl_AppendResult + 0x30
3   com.tcltk.tklibrary			    0x0b0905a4 TkGetServerInfo + 0x74
4   com.tcltk.tklibrary			    0x0b021500 Tk_WinfoObjCmd + 0x4b0
5   com.tcltk.tcllibrary		    0x0a00e344 TclEvalObjvInternal + 0x2a4
6   com.tcltk.tcllibrary		    0x0a030e10 TclExecuteByteCode + 0x94c
7   com.tcltk.tcllibrary		    0x0a030408 TclCompEvalObj + 0x160
8   com.tcltk.tcllibrary		    0x0a00efe8 Tcl_EvalObjEx + 0xc0
9   com.tcltk.tcllibrary		    0x0a03c334 Tcl_RecordAndEvalObj + 0xb4
10  com.tcltk.tcllibrary		    0x0a03c1f8 Tcl_RecordAndEval + 0x58
11  com.tcltk.tklibrary			    0x0b048374 StdinProc + 0x130
12  com.tcltk.tcllibrary		    0x0a044454 Tcl_NotifyChannel + 0x114
13  com.tcltk.tklibrary			    0x0b0860cc FileHandlerEventProc + 0x7c
14  com.tcltk.tcllibrary		    0x0a054380 Tcl_ServiceEvent + 0xa4
15  com.tcltk.tcllibrary		    0x0a054750 Tcl_DoOneEvent + 0x16c
16  com.tcltk.tklibrary			    0x0b02b60c Tk_MainLoop + 0x18
17  com.tcltk.tklibrary			    0x0b048220 Tk_MainEx + 0x31c

It works fine on my PowerBook with TkAqua 8.4.7, so it must have been
fixed somewhere in between.

-- 
=Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>


More information about the Pythonmac-SIG mailing list