Commits

Pierre-Yves David  committed 534e3f7

ensure session are closed.

  • Participants
  • Parent commits d954d72

Comments (0)

Files changed (1)

     events = client.changelog(target)
     repo.debug('there are %i entries in this changelog' % len(events))
     session = repo.internal_session(safe=True)
-    result = analyze_pypi_data(session, events)
-    if len(result):
-        repo.info('%i executions added' % len(result))
-    else:
-        repo.debug('no execution added')
-    session.close()
+    try:
+        result = analyze_pypi_data(session, events)
+        if len(result):
+            repo.info('%i executions added' % len(result))
+        else:
+            repo.debug('no execution added')
+    finally:
+        session.close()
 
 
 class ServerInitHook(hook.Hook):