Skip to content

Commit

Permalink
Merge f229019 into 839b4ab
Browse files Browse the repository at this point in the history
  • Loading branch information
flopon committed Apr 2, 2018
2 parents 839b4ab + f229019 commit 0fee65b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions enocean/protocol/eep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import print_function, unicode_literals, division, absolute_import
import os
import logging
from sys import version_info
from collections import OrderedDict
from bs4 import BeautifulSoup

Expand All @@ -17,8 +18,12 @@ def __init__(self):
self.telegrams = {}

try:
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r') as xml_file:
self.soup = BeautifulSoup(xml_file.read(), "html.parser")
if version_info[0] > 2:
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r', encoding='UTF-8') as xml_file:
self.soup = BeautifulSoup(xml_file.read(), "html.parser")
else:
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r') as xml_file:
self.soup = BeautifulSoup(xml_file.read(), "html.parser")
self.init_ok = True
self.__load_xml()
except IOError:
Expand Down

0 comments on commit 0fee65b

Please sign in to comment.