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):
269
269
with open (filename , 'r' ) as fh :
270
270
self .textedit .setText (fh .read ())
271
271
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 } " )
273
276
274
277
def saveFile (self ):
275
278
filename , _ = qtw .QFileDialog .getSaveFileName (
@@ -283,7 +286,10 @@ def saveFile(self):
283
286
with open (filename , 'w' ) as fh :
284
287
fh .write (self .textedit .toPlainText ())
285
288
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 } " )
287
293
288
294
def set_font (self ):
289
295
current = self .textedit .currentFont ()
You can’t perform that action at this time.
0 commit comments