]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
misc/check-interfaces.py: print a warning if a .pyc or .pyo file exists without a...
authordavid-sarah <david-sarah@jacaranda.org>
Wed, 12 Oct 2011 23:36:09 +0000 (16:36 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Wed, 12 Oct 2011 23:36:09 +0000 (16:36 -0700)
misc/coding_tools/check-interfaces.py

index 8d6487163acf51e45687cfe9daa27adac8d779ba..15e7d99b7dd780bce3ca7851b7259e46b80d490f 100644 (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('/', '.')