cubicweb/migration.py
changeset 12745 cc681b6fcffa
parent 12744 19aef4729d45
child 12752 3cf37ec616ad
--- a/cubicweb/migration.py	Wed May 22 17:08:09 2019 +0200
+++ b/cubicweb/migration.py	Wed May 22 17:10:06 2019 +0200
@@ -200,7 +200,7 @@
             return meth(*args, **kwargs)
 
     def confirm(self, question, # pylint: disable=E0202
-                shell=True, abort=True, retry=False, pdb=False, default='y'):
+                shell=True, abort=True, retry=False, pdb=False, default='y', traceback=None):
         """ask for confirmation and return true on positive answer
 
         if `retry` is true the r[etry] answer may return 2
@@ -226,11 +226,14 @@
             raise SystemExit(1)
         if answer == 'shell':
             self.interactive_shell()
-            return self.confirm(question, shell, abort, retry, pdb, default)
+            return self.confirm(question, shell, abort, retry, pdb, default, traceback)
         if answer == 'pdb':
             pdb = utils.get_pdb()
-            pdb.set_trace()
-            return self.confirm(question, shell, abort, retry, pdb, default)
+            if traceback:
+                pdb.post_mortem(traceback)
+            else:
+                pdb.set_trace()
+            return self.confirm(question, shell, abort, retry, pdb, default, traceback)
         return True
 
     def interactive_shell(self):