[Tutor] Help me to debug this script .. I tried but ....

Kent Johnson kent37 at tds.net
Sun Nov 5 16:53:37 CET 2006


Dustin J. Mitchell wrote:
> Asrarahmed Kadri wrote:
>> "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
>> line 310, in RunScript
>>     exec codeObject in __main__.__dict__
>>   File "C:\project stuff-programs\Scriptdate.py", line 18, in ?
>>     t1 = my_version_datecheck.dateCheck(dt1,0)
>>   File "my_version_datecheck.py", line 38, in dateCheck
>>     import traceback
>> NameError: global name 'traceback' is not defined
> 
> This tells you everything you need to know right here.
> 
> What version of Python are you using?  I know traceback existed at least in
> 2.3.  Might be time to consider an upgrade.

If traceback was not a valid module name the import would raise 
ImportError, not NameError.

Something strange is going on here; have you shown us all the code?

Kent



More information about the Tutor mailing list