diff options
| author | jdemeyer <jdemeyer@cage.ugent.be> | 2018-07-21 10:30:59 +0200 | 
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-07-21 11:30:59 +0300 | 
| commit | 56868f940e0cc0b35d33c0070107ff3bed2d8766 (patch) | |
| tree | cf89ed80def829ba86fee5c2c2db623db134fc34 /Lib/test | |
| parent | a692efe4733f98831cb51a9683877b152f754d14 (diff) | |
| download | cpython-git-56868f940e0cc0b35d33c0070107ff3bed2d8766.tar.gz | |
bpo-34126: Fix crashes while profiling invalid calls. (GH-8300)
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_sys_setprofile.py | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/Lib/test/test_sys_setprofile.py b/Lib/test/test_sys_setprofile.py index a3e1d31fbe..16467e7f71 100644 --- a/Lib/test/test_sys_setprofile.py +++ b/Lib/test/test_sys_setprofile.py @@ -334,6 +334,22 @@ class ProfileSimulatorTestCase(TestCaseBase):                                (1, 'return', j_ident),                                ]) +    # Test an invalid call (bpo-34126) +    def test_unbound_method_no_args(self): +        def f(p): +            dict.get() +        f_ident = ident(f) +        self.check_events(f, [(1, 'call', f_ident), +                              (1, 'return', f_ident)]) + +    # Test an invalid call (bpo-34126) +    def test_unbound_method_invalid_args(self): +        def f(p): +            dict.get(print, 42) +        f_ident = ident(f) +        self.check_events(f, [(1, 'call', f_ident), +                              (1, 'return', f_ident)]) +  def ident(function):      if hasattr(function, "f_code"): | 
