From 994fcbead917248b9cc67830e5186d2472f1580e Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 30 Apr 2021 15:41:50 -0700 Subject: [PATCH] Backport PR #12932: remove use of deprecated pipes module remove use of deprecated pipes module --- IPython/lib/editorhooks.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IPython/lib/editorhooks.py b/IPython/lib/editorhooks.py index 7ce0577a091..d8bd6ac81bc 100644 --- a/IPython/lib/editorhooks.py +++ b/IPython/lib/editorhooks.py @@ -6,7 +6,6 @@ """ 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)