diff --git a/IPython/core/history.py b/IPython/core/history.py index 7cf13a4..fb67d15 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -9,7 +9,6 @@ import datetime from pathlib import Path import re import sqlite3 -import sys import threading from traitlets.config.configurable import LoggingConfigurable @@ -30,14 +29,6 @@ from traitlets import ( observe, ) - -if sys.version_info >= (3, 12): - - def _adapt_datetime(val): - return val.isoformat(" ") - - sqlite3.register_adapter(datetime.datetime, _adapt_datetime) - #----------------------------------------------------------------------------- # Classes and functions #----------------------------------------------------------------------------- @@ -583,7 +574,7 @@ class HistoryManager(HistoryAccessor): cur = conn.execute( """INSERT INTO sessions VALUES (NULL, ?, NULL, NULL, '') """, - (datetime.datetime.now(),), + (datetime.datetime.now().isoformat(" "),), ) self.session_number = cur.lastrowid @@ -591,9 +582,15 @@ class HistoryManager(HistoryAccessor): """Close the database session, filling in the end time and line count.""" self.writeout_cache() with self.db: - self.db.execute("""UPDATE sessions SET end=?, num_cmds=? WHERE - session==?""", (datetime.datetime.now(), - len(self.input_hist_parsed)-1, self.session_number)) + self.db.execute( + """UPDATE sessions SET end=?, num_cmds=? WHERE + session==?""", + ( + datetime.datetime.now().isoformat(" "), + len(self.input_hist_parsed) - 1, + self.session_number, + ), + ) self.session_number = 0 def name_session(self, name): diff --git a/IPython/core/logger.py b/IPython/core/logger.py index eeaba24..ab12d10 100644 --- a/IPython/core/logger.py +++ b/IPython/core/logger.py @@ -20,7 +20,6 @@ import os import time - # prevent jedi/parso's debug messages pipe into interactiveshell logging.getLogger("parso").setLevel(logging.WARNING)