1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

[py3] Fixed compilemessages tests

This commit is contained in:
Claude Paroz
2012-08-08 23:40:20 +02:00
parent 180b672a65
commit 96a6912ec5
2 changed files with 7 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
from __future__ import unicode_literals
import codecs
import os
import sys
@@ -7,7 +9,7 @@ from django.core.management.base import BaseCommand, CommandError
def has_bom(fn):
with open(fn, 'rb') as f:
sample = f.read(4)
return sample[:3] == '\xef\xbb\xbf' or \
return sample[:3] == b'\xef\xbb\xbf' or \
sample.startswith(codecs.BOM_UTF16_LE) or \
sample.startswith(codecs.BOM_UTF16_BE)