Drop usage of six

We no longer need to support Python 2, so there's no point in this
compatibility layer.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2024-11-22 14:44:16 +01:00
parent 8558b74d78
commit b34de57813
57 changed files with 406 additions and 734 deletions

View file

@ -3,10 +3,9 @@
from __future__ import print_function
import os
import six
import shlex
from collections import namedtuple
from kobo.shortcuts import run
from six.moves import shlex_quote
from .wrappers import iso
from .wrappers.jigdo import JigdoWrapper
@ -41,13 +40,13 @@ def quote(str):
expanded.
"""
if str.startswith("$TEMPLATE"):
return "$TEMPLATE%s" % shlex_quote(str.replace("$TEMPLATE", "", 1))
return shlex_quote(str)
return "$TEMPLATE%s" % shlex.quote(str.replace("$TEMPLATE", "", 1))
return shlex.quote(str)
def emit(f, cmd):
"""Print line of shell code into the stream."""
if isinstance(cmd, six.string_types):
if isinstance(cmd, str):
print(cmd, file=f)
else:
print(" ".join([quote(x) for x in cmd]), file=f)