[Tutor] Modules/Setup in 2.2 source package [and IDLE in Slackware]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Thu, 27 Dec 2001 12:01:25 -0800 (PST)


On Thu, 27 Dec 2001, Rob McGee wrote:

> > I remember that on older versions of Python (1.52), I had to uncomment
> > sections of Modules/Setup when I wanted to get Tkinter working.
> 
> I went through and uncommented what was appropriate for Tkinter. I got
> IDLE to start and thus confirmed that Tkinter was working. However,
> IDLE died with a segfault when I tried to close its help ("press F1")

Yikes!  That's a serious problem; IDLE should never segfault that that.  
You might want to see if the same thing happens with the IDLEfork version
of IDLE:

    http://idlefork.sourceforge.net/

and if the same crash occurs, this is something that needs to be reported
to the IDLE developers.



> An interesting thing to note: IDLE from 2.0.1 doesn't work with the 2.2
> interpreter. It crashed with a SyntaxError:
>     import * is not allowed in function 'main' because it contains a
>     nested function with free variables

Yes; this is a result of the new scoping rules that were introduced in
Python 2.1:

    http://www.amk.ca/python/2.1/index.html#SECTION000300000000000000000

"""One side effect of the change is that the from module import * and exec
statements have been made illegal inside a function scope under certain
conditions. The Python reference manual has said all along that from
module import * is only legal at the top level of a module, but the
CPython interpreter has never enforced this before."""


They're enforcing it now.  *grin*


Best of wishes!