]> granicus.if.org Git - python/commitdiff
Replace the simpleminded string.find with a re.search looking only for
authorThomas Heller <theller@ctypes.org>
Tue, 16 Apr 2002 15:04:56 +0000 (15:04 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 16 Apr 2002 15:04:56 +0000 (15:04 +0000)
full words. Before that, something like 'PyObject_Call' was missed
because 'PyObject_CallFunction' was found.

Passes PyChecker now.

Doc/tools/undoc_symbols.py

index d7a9e5d552d1bdb8089c81e2c01a0731fb2ffe58..35281060408fba0555690738c07aea7abae26414 100644 (file)
@@ -46,7 +46,7 @@ INCLUDEPATTERN = "*.h"
 # v variable definitions
 # x extern and forward variable declarations
 
-import os, glob, re, sys, tempfile
+import os, glob, re, sys
 
 def findnames(file, prefixes=()):
     names = {}
@@ -83,7 +83,7 @@ def print_undoc_symbols(prefix, docdir, incdir):
     names = dict.keys()
     names.sort()
     for name in names:
-        if docs.find(name) == -1:
+        if not re.search("%s\\W" % name, docs):
             print dict[name], name
 
 if __name__ == '__main__':