[dataimport] do not use sys.exit() to raise missing argument error
authorAlain Leufroy <alain.leufroy@logilab.fr>
Tue, 03 Jun 2014 12:41:06 +0200
changeset 9904 2205c5e1edc2
parent 9903 d1fdbdbab194
child 9905 1fa35cc06c69
[dataimport] do not use sys.exit() to raise missing argument error Related to #3845572
dataimport.py
--- a/dataimport.py	Mon Jun 02 17:51:45 2014 +0200
+++ b/dataimport.py	Tue Jun 03 12:41:06 2014 +0200
@@ -622,10 +622,8 @@
     """ObjectStore that works with an actual RQL repository (production mode)"""
     _rql = None # bw compat
 
-    def __init__(self, session=None, commit=None):
+    def __init__(self, session, commit=None):
         ObjectStore.__init__(self)
-        if session is None:
-            sys.exit('please provide a session of run this script with cubicweb-ctl shell and pass cnx as session')
         if not hasattr(session, 'set_cnxset'):
             if hasattr(session, 'request'):
                 # connection object