mirror of
https://github.com/python/cpython.git
synced 2025-08-15 22:30:42 +00:00
[3.12] gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339) (#105526)
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339)
(cherry picked from commit 3ee921d84f
)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
b08ea9a561
commit
f565fed548
4 changed files with 21 additions and 51 deletions
|
@ -6,19 +6,12 @@ from test.support import requires
|
|||
from tkinter import Tk
|
||||
|
||||
from idlelib.tree import TreeNode, ScrolledCanvas
|
||||
import sys
|
||||
|
||||
|
||||
class StackBrowserTest(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
svs = stackviewer.sys
|
||||
try:
|
||||
abc
|
||||
except NameError:
|
||||
svs.last_type, svs.last_value, svs.last_traceback = (
|
||||
sys.exc_info())
|
||||
|
||||
requires('gui')
|
||||
cls.root = Tk()
|
||||
|
@ -26,8 +19,6 @@ class StackBrowserTest(unittest.TestCase):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
svs = stackviewer.sys
|
||||
del svs.last_traceback, svs.last_type, svs.last_value
|
||||
|
||||
cls.root.update_idletasks()
|
||||
## for id in cls.root.tk.call('after', 'info'):
|
||||
|
@ -36,7 +27,10 @@ class StackBrowserTest(unittest.TestCase):
|
|||
del cls.root
|
||||
|
||||
def test_init(self):
|
||||
sb = stackviewer.StackBrowser(self.root)
|
||||
try:
|
||||
abc
|
||||
except NameError as exc:
|
||||
sb = stackviewer.StackBrowser(self.root, exc)
|
||||
isi = self.assertIsInstance
|
||||
isi(stackviewer.sc, ScrolledCanvas)
|
||||
isi(stackviewer.item, stackviewer.StackTreeItem)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue