diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-03-04 16:59:30 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-03-05 09:24:11 +0100 |
commit | ed39c03e2f67e9dcc0b68a9740f73b79d252b76b (patch) | |
tree | 138a6efec597e5a396ed70d6f16f0403a7470dee /scripts/qapi/gen.py | |
parent | baa310f1bbdfedfd3e0f3f1f162bb97748ca0a94 (diff) |
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>
Diffstat (limited to 'scripts/qapi/gen.py')
-rw-r--r-- | scripts/qapi/gen.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index a53a705c73..317cd72601 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -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: |