eric6/Debugger/CallStackViewer.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7802
eefe954f01e8
child 7836
2f0d208b8137
equal deleted inserted replaced
7784:3257703e10c5 7785:9978016560ec
176 if not res: 176 if not res:
177 return 177 return
178 fname = Utilities.toNativeSeparators(fname) 178 fname = Utilities.toNativeSeparators(fname)
179 179
180 try: 180 try:
181 f = open(fname, "w", encoding="utf-8") 181 with open(fname, "w", encoding="utf-8") as f:
182 itm = self.topLevelItem(0) 182 itm = self.topLevelItem(0)
183 while itm is not None: 183 while itm is not None:
184 f.write("{0}\n".format(itm.text(0))) 184 f.write("{0}\n".format(itm.text(0)))
185 f.write(78 * "=" + "\n") 185 f.write(78 * "=" + "\n")
186 itm = self.itemBelow(itm) 186 itm = self.itemBelow(itm)
187 f.close()
188 except IOError as err: 187 except IOError as err:
189 E5MessageBox.critical( 188 E5MessageBox.critical(
190 self, 189 self,
191 self.tr("Error saving Call Stack Info"), 190 self.tr("Error saving Call Stack Info"),
192 self.tr("""<p>The call stack info could not be""" 191 self.tr("""<p>The call stack info could not be"""

eric ide

mercurial