"unused" variable become optional.

Adding this parameter broke one of my add-on, see
https://github.com/Arthur-Milchior/anki-keep-model-in-add-cards/issues/1

Since those parameters are not used, setting them to None by default,
as was done in some other method, seems acceptable
This commit is contained in:
Arthur Milchior 2020-01-23 21:46:42 -08:00
parent 9804105928
commit 66e1f876d7
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class AddCards(QDialog):
def setAndFocusNote(self, note: Note) -> None:
self.editor.setNote(note, focusTo=0)
def onModelChange(self, unused) -> None:
def onModelChange(self, unused=None) -> None:
oldNote = self.editor.note
note = self.mw.col.newNote()
self.previousNote = None

View File

@ -66,7 +66,7 @@ class DeckChooser(QHBoxLayout):
def cleanup(self) -> None:
gui_hooks.current_note_type_did_change.remove(self.onModelChangeNew)
def onModelChangeNew(self, unused):
def onModelChangeNew(self, unused=None):
self.onModelChange()
def onModelChange(self):