PyPy3: AttributeError: 'Frame' object has no attribute 'clear'

Create issue
Issue #2532 invalid
Jason Madden created an issue

Running PyPy3-3.5-5.7.1-beta from pyenv on Ubuntu 14.04 (Travis CI) for the gevent unit tests. When there is code that uses TestCase.assertRaises, the following stack trace may be raised (https://travis-ci.org/gevent/gevent/jobs/219394025#L456):

    File "test__event.py", line 146, in test_set_exception
      self.assertRaises(greentest.ExpectedException, s1.get)
    File "/home/travis/.runtimes/versions/pypy3.5_571/lib-python/3/unittest/case.py", line 728, in assertRaises
      return context.handle('assertRaises', args, kwargs)
    File "/home/travis/.runtimes/versions/pypy3.5_571/lib-python/3/unittest/case.py", line 177, in handle
      callable_obj(*args, **kwargs)
    File "/home/travis/.runtimes/versions/pypy3.5_571/lib-python/3/unittest/case.py", line 201, in __exit__
      traceback.clear_frames(tb)
    File "/home/travis/.runtimes/versions/pypy3.5_571/lib-python/3/traceback.py", line 216, in clear_frames
      tb.tb_frame.clear()
  AttributeError: 'Frame' object has no attribute 'clear'

The docs indicated that clear_frames was added in 3.4 and the call from unittest was added in issue 9815 slightly later.

(Apologies if this is a known issue, if so I didn't find it anywhere.)

Comments (3)

  1. Jason Madden reporter

    Argh, sorry. I checked for a clear method on the frame, but it turned out I was still checking in 3.3.5 (turns out it's easy to transpose or misread 3.3.5 and 3.5.3). I do see a clear method in 3.5.3.

    Given that, I'm pretty sure I see what's happening now.

  2. Log in to comment