Re: Weird import behavior

2005-10-26 Thread Tommytrojan
Thanks for the clarification. I never ran into this before although I have been working with Python for over 8 years. Good to learn something new. Cheers, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird import behavior

2005-10-26 Thread Fredrik Lundh
"Tommytrojan" wrote: > thanks for your quick reply. I guess I should have included the output. > I thought I was clear in the error description. > The problem is that I never assign to 'string'. I only reference it (as > the error message correctly states). If you comment out the import > statemen

Re: Weird import behavior

2005-10-25 Thread Duncan Booth
Tommytrojan wrote: > Duncan, > > thanks for your quick reply. I guess I should have included the output. > I thought I was clear in the error description. > The problem is that I never assign to 'string'. I only reference it (as > the error message correctly states). If you comment out the import

Re: Weird import behavior

2005-10-25 Thread Tommytrojan
Duncan, thanks for your quick reply. I guess I should have included the output. I thought I was clear in the error description. The problem is that I never assign to 'string'. I only reference it (as the error message correctly states). If you comment out the import statement in the except clause

Re: Weird import behavior

2005-10-25 Thread Duncan Booth
Tommytrojan wrote: > import string > import os > > class T: > def __init__(self): > try: > print 'xxx nothing to do' > except ImportError: > print 'got an import error' > import os as string > > print ' string module', string >

Weird import behavior

2005-10-25 Thread Tommytrojan
Hi, I have been using Python for a while but today I came across a really strange behavior: While poking around in Queue.py due to problems with importing this module from a thread I got an error that a module that I imported on top of the file could not be accessed. I reduced the problem to this