test

Benji York benji at benjiyork.com
Wed Jun 8 08:03:37 EDT 2005


Nader Emami wrote:
>    File "/usr/lib/python2.3/unittest.py", line 657, in run
>      startTime = time.time()
> AttributeError: 'module' object has no attribute 'time'

I suspect that you have a module named "time.py" that is being 
imported instead of the standard library's time module.  Do this to 
see where the module is coming from:

 >>> import time
 >>> time.time() # make sure you still get the exception
 >>> time.__file__
'/usr/lib/python2.3/lib-dynload/time.so'

Be sure to do this in exactly the same way (same path, same Python, 
same user, etc.) that you are running your tests.  Your file name may 
not match mine, but if it points to something other than the standard 
library, you've found the problem.
--
Benji York



More information about the Python-list mailing list