From 3755624850ebf09bf84a48280436715de0d54e42 Mon Sep 17 00:00:00 2001 From: David Shea Date: Mar 04 2025 20:41:03 +0000 Subject: Use six to wrap shlex.quote shlex.quote was added in Python 3.3. This change maintains compatibility with python 2.7 for RHEL-7. Signed-off-by: David Shea --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index e14a63e..f230a25 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -22,7 +22,6 @@ import os import posixpath import random import re -import shlex import shutil import stat import subprocess @@ -836,7 +835,7 @@ class Commands(object): rpm_cmd.extend(["-q", "--qf", "??%{NAME} %{EPOCH} %{VERSION} %{RELEASE}??", "--specfile", "%s" % os.path.join(tmp_root, self.spec)]) # escape whole 'rpm' command because it will be executed under mock command - rpm_cmd = [shlex.quote(item) for item in rpm_cmd] + rpm_cmd = [six.moves.shlex_quote(item) for item in rpm_cmd] main_cmd = cmd + ['--shell'] + rpm_cmd \ + ['> ' + os.path.join(tmp_root, 'output')]