Strange problem when using imp.load_module

pythoncurious at gmail.com pythoncurious at gmail.com
Fri Apr 24 02:01:01 EDT 2009


Well spotted :)
That does seem to be the problem. Adding removal of the .pyc file will
make the tests pass.

I guess that python doesn't use the higher resolution timestamp
you can get from at least Solaris when doing 'stat' on a file.

Thanks for the help.

/Mattias



On Apr 23, 10:28 pm, Arnaud Delobelle <arno... at googlemail.com> wrote:
>
> My guess is that without the sleep(1), the imp.load_source function will
> use the compiled file 'my_module.pyc' created in test_1 instead of
> compiling the new 'my_module.py' file.
>
>
> HTH
>
> --
> Arnaud




More information about the Python-list mailing list