##// END OF EJS Templates
use pathlib in ipython-get-history.py
rushabh-v -
Show More
@@ -17,13 +17,15 b' to build much more flexible and powerful tools to browse and pull from the'
17 17 history database.
18 18 """
19 19 import sys
20 from pathlib import Path
20 21
21 22 from IPython.core.history import HistoryAccessor
22 23
23 24 session_number = int(sys.argv[1])
24 25 if len(sys.argv) > 2:
25 dest = open(sys.argv[2], "w")
26 raw = not sys.argv[2].endswith('.py')
26 filepath = Path(sys.argv[2])
27 dest = open(filepath, "w")
28 raw = not filepath.name.endswith('.py')
27 29 else:
28 30 dest = sys.stdout
29 31 raw = True
General Comments 0
You need to be logged in to leave comments. Login now