Module's source changes don't take effect
I am having an issue with python which looks really weird to me. My script starts to be quite big and is suposed to run a test suite for a program. My inclusion tree is:
run.py --> Module --> Section --> Test
The weird behavior I am having is that when I add a modification to my Module
, Section
or Test
module's source file, they don't take effect at all.
I am developing with emacs in my terminal and simply run my script using:
python run.py
I tried:
- Restarting the term
- Restarting the computer (after a few d开发者_如何学Cays, it wasn't a bad idea anyway)
- Cleaning the *.pyc files
The version of my python is 2.5.2
and I am working under a Debian Lenny in VirtualBox.
And I haven't been able to reproduce this behavior on another smaller program to observe it better.
I suspect you have at least one other module with the same name as one of yours in your PYTHONPATH. Either look for old copies you left around or try changing your module names and see what happens.
You'd see a similar effect if you forgot to reload your modules before running them after you modified them, but restarting your Python session would obviously cause all your modules to be loaded afresh at the first import of each.
精彩评论