method .index removed from Python3 string module; not needed anyway

This commit is contained in:
Martin A. Brown 2016-02-12 13:24:55 -08:00
parent 7affd10e0c
commit 85b8df5e86
1 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@
from __future__ import absolute_import, division, print_function
import string
from ..utils import logger
@ -11,10 +10,10 @@ class SignatureChecker(object):
@classmethod
def signatureLocation(cls, f):
f.seek(0)
buf = f.read(1024)
buf = f.read(1024).lower()
for sig in cls.signatures:
try:
sindex = string.index(buf.lower(), sig.lower())
sindex = buf.index(sig.lower())
logger.debug("Found signature %s in %s at %s; doctype %s.",
sig, f.name, sindex, cls)
return sindex