[FIX] P3: bytes.startswith(bytes)

This commit is contained in:
Xavier Morel
2017-08-20 23:25:54 +02:00
committed by Olivier Dony
parent 30a9e6602c
commit c24ab97c52
+1 -1
View File
@@ -93,7 +93,7 @@ class IrAttachment(models.Model):
'''Index PDF documents'''
buf = u""
if bin_data.startswith('%PDF-'):
if bin_data.startswith(b'%PDF-'):
f = io.BytesIO(bin_data)
try:
pdf = PyPDF2.PdfFileReader(f, overwriteWarnings=False)