##// END OF EJS Templates
use pathlib in crashhandler
PhanatosZou -
Show More
@@ -23,6 +23,7 b' import os'
23 import sys
23 import sys
24 import traceback
24 import traceback
25 from pprint import pformat
25 from pprint import pformat
26 from pathlib import Path
26
27
27 from IPython.core import ultratb
28 from IPython.core import ultratb
28 from IPython.core.release import author_email
29 from IPython.core.release import author_email
@@ -151,10 +152,10 b' class CrashHandler(object):'
151 try:
152 try:
152 rptdir = self.app.ipython_dir
153 rptdir = self.app.ipython_dir
153 except:
154 except:
154 rptdir = os.getcwd()
155 rptdir = Path.cwd()
155 if rptdir is None or not os.path.isdir(rptdir):
156 if rptdir is None or not Path.is_dir(rptdir):
156 rptdir = os.getcwd()
157 rptdir = Path.cwd()
157 report_name = os.path.join(rptdir,self.crash_report_fname)
158 report_name = rptdir / self.crash_report_fname
158 # write the report filename into the instance dict so it can get
159 # write the report filename into the instance dict so it can get
159 # properly expanded out in the user message template
160 # properly expanded out in the user message template
160 self.crash_report_fname = report_name
161 self.crash_report_fname = report_name
General Comments 0
You need to be logged in to leave comments. Login now