Skip to content

Commit

Permalink
gui: replace usage of stdlib pipes library with shlex (bug 1914478) (#…
Browse files Browse the repository at this point in the history
…1846)

Python 3.13 removed the already deprecated "pipes" module from the
standard library.
Some files were using the "quote" function from pipes, which prior to
3.13 was a re-export of a function with the same name in "shlex".

This change imports the shlex module directly.

https://github.com/python/cpython/blob/3.12/Lib/pipes.py#L66
https://docs.python.org/3/whatsnew/3.13.html
  • Loading branch information
jdmnd authored Nov 6, 2024
1 parent ec3c8b4 commit 0c5a812
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gui/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import argparse
import glob
import os
import pipes
import shlex
import shutil
import subprocess
import sys
Expand All @@ -19,7 +19,7 @@


def call(*args, **kwargs):
print("Executing `%s`" % " ".join(pipes.quote(a) for a in args))
print("Executing `%s`" % " ".join(shlex.quote(a) for a in args))
subprocess.check_call(args, **kwargs)


Expand Down
4 changes: 2 additions & 2 deletions mozregression/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import atexit
import os
import pipes
import shlex
import sys

import colorama
Expand Down Expand Up @@ -265,7 +265,7 @@ def _print_resume_info(self, handler):
argv.append("--bad=%s" % handler.bad_revision)

LOG.info("To resume, run:")
LOG.info(" ".join([pipes.quote(arg) for arg in argv]))
LOG.info(" ".join([shlex.quote(arg) for arg in argv]))

def _on_exit_print_resume_info(self, handler):
handler.print_range()
Expand Down

0 comments on commit 0c5a812

Please sign in to comment.