| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -398,6 +398,12 @@ def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None, | |||
| 398 | 398 | ||
| 399 | 399 | self._current_task = None | |
| 400 | 400 | ||
| 401 | + self.lineno = None | ||
| 402 | + self.stack = [] | ||
| 403 | + self.curindex = 0 | ||
| 404 | + self.curframe = None | ||
| 405 | + self._user_requested_quit = False | ||
| 406 | + | ||
| 401 | 407 | def set_trace(self, frame=None, *, commands=None): | |
| 402 | 408 | Pdb._last_pdb_instance = self | |
| 403 | 409 | if frame is None: | |
@@ -474,7 +480,7 @@ def forget(self): | |||
| 474 | 480 | self.lineno = None | |
| 475 | 481 | self.stack = [] | |
| 476 | 482 | self.curindex = 0 | |
| 477 | - if hasattr(self, 'curframe') and self.curframe: | ||
| 483 | + if self.curframe: | ||
| 478 | 484 | self.curframe.f_globals.pop('__pdb_convenience_variables', None) | |
| 479 | 485 | self.curframe = None | |
| 480 | 486 | self.tb_lineno.clear() | |
@@ -1493,7 +1499,7 @@ def checkline(self, filename, lineno, module_globals=None): | |||
| 1493 | 1499 | """ | |
| 1494 | 1500 | # this method should be callable before starting debugging, so default | |
| 1495 | 1501 | # to "no globals" if there is no current frame | |
| 1496 | - frame = getattr(self, 'curframe', None) | ||
| 1502 | + frame = self.curframe | ||
| 1497 | 1503 | if module_globals is None: | |
| 1498 | 1504 | module_globals = frame.f_globals if frame else None | |
| 1499 | 1505 | line = linecache.getline(filename, lineno, module_globals) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Initialize all Pdb's instance variables in ``__init__``, remove some hasattr/getattr | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments