def __enter__(self): if not self._conn: self._conn = libvirt.openReadOnly(self._con_str) return self._conn