Commit 04ed6285 authored by Michal Čihař's avatar Michal Čihař

Compatibility with Python 3

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 713b5427
......@@ -20,6 +20,8 @@
from __future__ import unicode_literals
import io
from django.db import models, transaction
from django.db.utils import OperationalError
from django.utils.encoding import python_2_unicode_compatible, force_text
......@@ -305,9 +307,9 @@ class LanguageManager(models.Manager):
Checks database language definitions with supplied ones.
"""
errors = []
with open(filename) as handle:
with io.open(filename) as handle:
for line in handle:
line = line.strip().decode('utf-8')
line = line.strip()
parts = [part.strip() for part in line.split(',')]
if len(parts) != 3:
continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment