From a9c5e02a1afc101ef50cfc94197d5da3e776a86a 2021-04-30 10:29:32 From: Min RK Date: 2021-04-30 10:29:32 Subject: [PATCH] remove use of deprecated pipes module pipes.quote is actually an alias to shlex.quote deprecated by PEP 594, to be removed in 3.10 --- diff --git a/IPython/lib/editorhooks.py b/IPython/lib/editorhooks.py index 7ce0577..d8bd6ac 100644 --- a/IPython/lib/editorhooks.py +++ b/IPython/lib/editorhooks.py @@ -6,7 +6,6 @@ Contributions are *very* welcome. """ import os -import pipes import shlex import subprocess import sys @@ -47,9 +46,9 @@ def install_editor(template, wait=False): def call_editor(self, filename, line=0): if line is None: line = 0 - cmd = template.format(filename=pipes.quote(filename), line=line) + cmd = template.format(filename=shlex.quote(filename), line=line) print(">", cmd) - # pipes.quote doesn't work right on Windows, but it does after splitting + # shlex.quote doesn't work right on Windows, but it does after splitting if sys.platform.startswith('win'): cmd = shlex.split(cmd) proc = subprocess.Popen(cmd, shell=True)