context number_of_lines Set the number of lines of source code to show when displaying stacktrace information.
(self, context: str)
| 1371 | self._show_ignored_modules() |
| 1372 | |
| 1373 | def do_context(self, context: str): |
| 1374 | """context number_of_lines |
| 1375 | Set the number of lines of source code to show when displaying |
| 1376 | stacktrace information. |
| 1377 | """ |
| 1378 | try: |
| 1379 | new_context = int(context) |
| 1380 | if new_context <= 0: |
| 1381 | raise ValueError() |
| 1382 | self.context = new_context |
| 1383 | except ValueError: |
| 1384 | self.error( |
| 1385 | f"The 'context' command requires a positive integer argument (current value {self.context})." |
| 1386 | ) |
| 1387 | |
| 1388 | |
| 1389 | class InterruptiblePdb(Pdb): |