Strange problem when using imp.load_module

pythoncurious at pythoncurious at
Fri Apr 24 08:01:01 CEST 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.


On Apr 23, 10:28 pm, Arnaud Delobelle <arno... at> 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 '' file.
> --
> Arnaud

More information about the Python-list mailing list