diff --git a/anki/collection.py b/anki/collection.py index 5ee1584b7..0c8a41f54 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -849,6 +849,8 @@ and queue = 0""", intTime(), self.usn()) self._logHnd = open(lpath, "a", encoding="utf8") def _closeLog(self): + if not self._debugLog: + return self._logHnd.close() self._logHnd = None