qapi: Drop conditionals for Python 2

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200304155932.20452-3-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
Markus Armbruster 2020-03-04 16:59:30 +01:00
parent baa310f1bb
commit ed39c03e2f
4 changed files with 4 additions and 20 deletions

View file

@ -16,7 +16,6 @@
import os
import re
import sys
from collections import OrderedDict
from qapi.error import QAPIParseError, QAPISemError
@ -30,10 +29,7 @@ class QAPISchemaParser:
previously_included.add(os.path.abspath(fname))
try:
if sys.version_info[0] >= 3:
fp = open(fname, 'r', encoding='utf-8')
else:
fp = open(fname, 'r')
fp = open(fname, 'r', encoding='utf-8')
self.src = fp.read()
except IOError as e:
raise QAPISemError(incl_info or QAPISourceInfo(None, None, None),