leftover pyc files

Peter Otten __peter__ at web.de
Wed Nov 2 11:03:48 EDT 2011


Andrea Crotti wrote:

> In our current setup, the script in charge to run our applications also
> scan all the directories and if it finds any "pyc" file without the
> corresponding
> module, it removes it.
> 
> This was done because when you rename something, the old "pyc" remains
> there and can cause problems.
> 
> Is it the only way possible to scan through and remove all of them or is
> there a smarter way?

Switch to Python3.2 ;)

http://docs.python.org/dev/py3k/whatsnew/3.2.html#pep-3147-pyc-repository-directories
http://www.python.org/dev/peps/pep-3147/#case-4-legacy-pyc-files-and-source-less-imports





More information about the Python-list mailing list