bug/poor tracebacks while importing code

Robin Becker robin at jessikat.fsnet.co.uk
Wed Oct 2 11:09:39 EDT 2002


Is there some reason why we have poor code inspection during imports.
b.py isn't mentioned in the traceback obtained in c.py in the following
noddy example and this is limiting my ability to do nasty import tricks.
This is with stock win32 2.2.1.

C:\Python\tmp>cat b.py
'''
BBBBBBBB
'''
a=4
import c
b=6
c=7
d=8

C:\Python\tmp>cat c.py
'''
CCCCCCCC
'''
a=4
b=5
c=6
d=7
def xxx():
    import traceback, sys
    try:
        raise ValueError
    except:
        traceback.print_exc()
xxx()

C:\Python\tmp>b.py
Traceback (most recent call last):
  File "C:\Python\tmp\c.py", line 11, in xxx
    raise ValueError
ValueError

C:\Python\tmp>rem no mention of the importing module WHY?
-- 
Robin Becker



More information about the Python-list mailing list