MCPcopy Create free account
hub / github.com/ipython/ipython / _db_changed

Method _db_changed

IPython/core/history.py:189–198  ·  view source on GitHub ↗

validate the db, since it can be an Instance of two different types

(self, change)

Source from the content-addressed store, hash-verified

187 db = Any()
188 @observe('db')
189 def _db_changed(self, change):
190 """validate the db, since it can be an Instance of two different types"""
191 new = change['new']
192 connection_types = (DummyDB,)
193 if sqlite3 is not None:
194 connection_types = (DummyDB, sqlite3.Connection)
195 if not isinstance(new, connection_types):
196 msg = "%s.db must be sqlite3 Connection or DummyDB, not %r" % \
197 (self.__class__.__name__, new)
198 raise TraitError(msg)
199
200 def __init__(self, profile='default', hist_file=u'', **traits):
201 """Create a new history accessor.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected