lister.core.db_utils: Remove dead code
This commit is contained in:
parent
f92ac83646
commit
6b1c3d1fee
1 changed files with 0 additions and 18 deletions
|
@ -1,18 +0,0 @@
|
|||
# Copyright (C) 2015 Stefano Zacchiroli <zack@upsilon.cc>
|
||||
# License: GNU General Public License version 3, or any later version
|
||||
# See top-level LICENSE file for more information
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
@contextmanager
|
||||
def session_scope(mk_session):
|
||||
session = mk_session()
|
||||
try:
|
||||
yield session
|
||||
session.commit()
|
||||
except: # noqa
|
||||
session.rollback()
|
||||
raise
|
||||
finally:
|
||||
session.close()
|
Loading…
Add table
Add a link
Reference in a new issue