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
|
@ -15,7 +15,6 @@
|
|||
import errno
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
|
||||
from qapi.common import *
|
||||
|
@ -54,10 +53,7 @@ class QAPIGen:
|
|||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
fd = os.open(pathname, os.O_RDWR | os.O_CREAT, 0o666)
|
||||
if sys.version_info[0] >= 3:
|
||||
f = open(fd, 'r+', encoding='utf-8')
|
||||
else:
|
||||
f = os.fdopen(fd, 'r+')
|
||||
f = open(fd, 'r+', encoding='utf-8')
|
||||
text = self.get_content()
|
||||
oldtext = f.read(len(text) + 1)
|
||||
if text != oldtext:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue