[Idle-dev] Bug in Python 1.6 (#0, Sep 5 2000, 08:16:13) [MSC 32 bit (Intel) ] on win32

Linder, Bob Bob_Linder@NAI.com
Wed, 4 Oct 2000 06:49:43 -0700


I am using Python 1.6 (#0, Sep  5 2000, 08:16:13) [MSC 32 bit (Intel)] on
win32

I am currently learning Tkinter, so I am tracing 'IDLE' code to learn it.


In TreeWidget.py, assignment of '_icondir' using '__file__' is wrong,
'sys.argv[0]' works.

'__file__' looks like 'C/C++' syntax.

The way I found this problem by copying file to another directory and
running it.

 
# Look for Icons subdirectory in the same directory as this module
try:
    #_icondir = os.path.join(os.path.dirname(__file__), ICONDIR)
	_icondir = os.path.join(os.path.dirname(sys.argv[0]), ICONDIR)
except NameError:
    _icondir = ICONDIR
if os.path.isdir(_icondir):
    ICONDIR = _icondir
elif not os.path.isdir(ICONDIR):
    raise RuntimeError, "can't find icon directory (%s)" % `ICONDIR`