From fcafc40701916e5225dfeccf32b4fef17dd23b8a 2011-10-02 22:08:18 From: Bernard Paulus Date: 2011-10-02 22:08:18 Subject: [PATCH] Issue https://github.com/ipython/ipython/issues/832 resolution --- diff --git a/IPython/core/logger.py b/IPython/core/logger.py index 9fba405..d83ec69 100644 --- a/IPython/core/logger.py +++ b/IPython/core/logger.py @@ -206,8 +206,11 @@ which already exists. But you must first start the logging process with made, possibly (though not necessarily) with a new filename, mode and other options.""" - self.logfile.close() - self.logfile = None + if self.logfile is not None: + self.logfile.close() + self.logfile = None + else: + print "Logging hadn't been started." self.log_active = False # For backwards compatibility, in case anyone was using this.