Skip to content

Commit

Permalink
Use pathlib instead of os in IPython/lib/hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandanChainani committed Oct 13, 2022
1 parent b4b0e18 commit 62f8e7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPython/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def load_ipython_extension(ip):
# the file COPYING, distributed as part of this software.
#*****************************************************************************

import os
import subprocess
import sys
from pathlib import Path

from .error import TryNext

Expand Down Expand Up @@ -75,7 +75,7 @@ def editor(self, filename, linenum=None, wait=True):
linemark = '+%d' % int(linenum)

# Enclose in quotes if necessary and legal
if ' ' in editor and os.path.isfile(editor) and editor[0] != '"':
if " " in editor and Path(editor).is_file() and editor[0] != '"':
editor = '"%s"' % editor

# Call the actual editor
Expand Down

0 comments on commit 62f8e7d

Please sign in to comment.