From 435afed32536ea5083f7f1782284556dae44390a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 12 Dec 2017 11:55:27 +1000 Subject: [PATCH] fix error when importing --- anki/collection.py | 2 ++ 1 file changed, 2 insertions(+) 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