misc/check-interfaces.py: print a warning if a .pyc or .pyo file exists without a corresponding .py file.

This commit is contained in:
david-sarah 2011-10-12 16:36:09 -07:00
parent 5ae446fbd2
commit cbd0569e45

View File

@ -65,6 +65,10 @@ def check():
for (dirpath, dirnames, filenames) in os.walk(srcdir):
for fn in filenames:
(basename, ext) = os.path.splitext(fn)
if ext in ('.pyc', '.pyo') and not os.path.exists(os.path.join(dirpath, basename+'.py')):
print >>sys.stderr, ("Warning: no .py source file for %r.\n"
% (os.path.join(dirpath, fn),))
if ext == '.py' and not excluded_file_basenames.match(basename):
relpath = os.path.join(dirpath[len(srcdir)+1:], basename)
module = relpath.replace(os.sep, '/').replace('/', '.')