mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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:
parent
baa310f1bb
commit
ed39c03e2f
4 changed files with 4 additions and 20 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue