My 'time' module is broken, unsure of cause

Will Maier willmaier at ml1.net
Thu Aug 23 13:34:12 EDT 2007


On Thu, Aug 23, 2007 at 11:22:55AM -0600, darren kirby wrote:
> Python 2.4.4 (#1, Aug 23 2007, 10:51:29)
> [GCC 4.1.2 (Gentoo 4.1.2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import time
> 40:42:0
> >>> now = time.time()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: 'module' object has no attribute 'time'

Uh...that's obviously not right (as you noticed). You probably have
a different module that's shadowing the stdlib's time. To check:

    Python 2.4.4 (#1, Jul 26 2007, 14:42:10)
    [GCC 3.3.5 (propolice)] on openbsd4
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import time
    >>> print time.__file__
    /usr/local/lib/python2.4/lib-dynload/time.so

-- 

[Will Maier]-----------------[willmaier at ml1.net|http://www.lfod.us/]



More information about the Python-list mailing list