turn the postmortem traceback selection to a function
This commit is contained in:
		
							parent
							
								
									0bc98eb9d2
								
							
						
					
					
						commit
						73446e98be
					
				|  | @ -71,13 +71,13 @@ class PdbInvoke: | ||||||
|         rep.toterminal(tw) |         rep.toterminal(tw) | ||||||
|         tw.sep(">", "entering PDB") |         tw.sep(">", "entering PDB") | ||||||
| 
 | 
 | ||||||
|         tb = self._postmortem_traceback(call.excinfo) |         tb = _postmortem_traceback(call.excinfo) | ||||||
|         post_mortem(tb) |         post_mortem(tb) | ||||||
|         rep._pdbshown = True |         rep._pdbshown = True | ||||||
|         return rep |         return rep | ||||||
| 
 | 
 | ||||||
|     @staticmethod | 
 | ||||||
|     def _postmortem_traceback(excinfo): | def _postmortem_traceback(excinfo): | ||||||
|     # A doctest.UnexpectedException is not useful for post_mortem. |     # A doctest.UnexpectedException is not useful for post_mortem. | ||||||
|     # Use the underlying exception instead: |     # Use the underlying exception instead: | ||||||
|     if isinstance(excinfo.value, py.std.doctest.UnexpectedException): |     if isinstance(excinfo.value, py.std.doctest.UnexpectedException): | ||||||
|  | @ -85,6 +85,7 @@ class PdbInvoke: | ||||||
|     else: |     else: | ||||||
|         return excinfo._excinfo[2] |         return excinfo._excinfo[2] | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| def post_mortem(t): | def post_mortem(t): | ||||||
|     pdb = py.std.pdb |     pdb = py.std.pdb | ||||||
|     class Pdb(pdb.Pdb): |     class Pdb(pdb.Pdb): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue