Skip to content

Commit

Permalink
Merge pull request #13669 from achhina/fix-issue-12967
Browse files Browse the repository at this point in the history
Replaced string path in _dh with PosixPath()
  • Loading branch information
Carreau committed Aug 30, 2022
2 parents ae639fb + 6e3d5b4 commit c2c6349
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions IPython/core/magics/osm.py
Expand Up @@ -8,6 +8,7 @@

import io
import os
import pathlib
import re
import sys
from pprint import pformat
Expand Down Expand Up @@ -409,7 +410,7 @@ def cd(self, parameter_s=''):
except OSError:
print(sys.exc_info()[1])
else:
cwd = os.getcwd()
cwd = pathlib.Path.cwd()
dhist = self.shell.user_ns['_dh']
if oldcwd != cwd:
dhist.append(cwd)
Expand All @@ -419,7 +420,7 @@ def cd(self, parameter_s=''):
os.chdir(self.shell.home_dir)
if hasattr(self.shell, 'term_title') and self.shell.term_title:
set_term_title(self.shell.term_title_format.format(cwd="~"))
cwd = os.getcwd()
cwd = pathlib.Path.cwd()
dhist = self.shell.user_ns['_dh']

if oldcwd != cwd:
Expand Down

0 comments on commit c2c6349

Please sign in to comment.