##// END OF EJS Templates
Replaced getting cwd from os.getcwd() to pathlib.Path.cwd() in cd().
Aman -
Show More
@@ -8,6 +8,7 b' builtin.'
8
8
9 import io
9 import io
10 import os
10 import os
11 import pathlib
11 import re
12 import re
12 import sys
13 import sys
13 from pprint import pformat
14 from pprint import pformat
@@ -409,7 +410,7 b' class OSMagics(Magics):'
409 except OSError:
410 except OSError:
410 print(sys.exc_info()[1])
411 print(sys.exc_info()[1])
411 else:
412 else:
412 cwd = os.getcwd()
413 cwd = pathlib.Path.cwd()
413 dhist = self.shell.user_ns['_dh']
414 dhist = self.shell.user_ns['_dh']
414 if oldcwd != cwd:
415 if oldcwd != cwd:
415 dhist.append(cwd)
416 dhist.append(cwd)
@@ -419,7 +420,7 b' class OSMagics(Magics):'
419 os.chdir(self.shell.home_dir)
420 os.chdir(self.shell.home_dir)
420 if hasattr(self.shell, 'term_title') and self.shell.term_title:
421 if hasattr(self.shell, 'term_title') and self.shell.term_title:
421 set_term_title(self.shell.term_title_format.format(cwd="~"))
422 set_term_title(self.shell.term_title_format.format(cwd="~"))
422 cwd = os.getcwd()
423 cwd = pathlib.Path.cwd()
423 dhist = self.shell.user_ns['_dh']
424 dhist = self.shell.user_ns['_dh']
424
425
425 if oldcwd != cwd:
426 if oldcwd != cwd:
General Comments 0
You need to be logged in to leave comments. Login now