File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,10 @@ def openFile(self):
269269 with open (filename , 'r' ) as fh :
270270 self .textedit .setText (fh .read ())
271271 except Exception as e :
272- qtw .QMessageBox .critical (f"Could not load file: { e } " )
272+ # Errata: Book contains the following line:
273+ #qtw.QMessageBox.critical(f"Could not load file: {e}")
274+ # It should read like this:
275+ qtw .QMessageBox .critical (self , f"Could not load file: { e } " )
273276
274277 def saveFile (self ):
275278 filename , _ = qtw .QFileDialog .getSaveFileName (
@@ -283,7 +286,10 @@ def saveFile(self):
283286 with open (filename , 'w' ) as fh :
284287 fh .write (self .textedit .toPlainText ())
285288 except Exception as e :
286- qtw .QMessageBox .critical (f"Could not save file: { e } " )
289+ # Errata: Book contains this line:
290+ #qtw.QMessageBox.critical(f"Could not save file: {e}")
291+ # It should read like this:
292+ qtw .QMessageBox .critical (self , f"Could not load file: { e } " )
287293
288294 def set_font (self ):
289295 current = self .textedit .currentFont ()
You can’t perform that action at this time.
0 commit comments