Bug 1069689, part 2 - Don't generate a regexp then throw it away. r=jmaher

This commit is contained in:
Andrew McCreight 2014-09-19 15:00:43 -07:00
parent 28ff62477b
commit ef73dc680f

View File

@ -312,10 +312,11 @@ def processLeakLog(leakLogFile, leakThreshold = 0):
log.info("TEST-INFO | leakcheck | threshold set at %d bytes" % leakThreshold)
(leakLogFileDir, leakFileBase) = os.path.split(leakLogFile)
fileNameRegExp = re.compile(r"_([a-z]*)_pid\d*$")
if leakFileBase[-4:] == ".log":
leakFileBase = leakFileBase[:-4]
fileNameRegExp = re.compile(r"_([a-z]*)_pid\d*.log$")
else:
fileNameRegExp = re.compile(r"_([a-z]*)_pid\d*$")
for fileName in os.listdir(leakLogFileDir):
if fileName.find(leakFileBase) != -1: