[pypy-issue] Issue #2532: PyPy3: AttributeError: 'Frame' object has no attribute 'clear' (pypy/pypy)

Jason Madden issues-reply at bitbucket.org
Thu Apr 6 15:09:51 EDT 2017


New issue 2532: PyPy3: AttributeError: 'Frame' object has no attribute 'clear'
https://bitbucket.org/pypy/pypy/issues/2532/pypy3-attributeerror-frame-object-has-no

Jason Madden:

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](https://docs.python.org/3/library/traceback.html#traceback.clear_frames) indicated that `clear_frames` was added in 3.4 and the call from unittest was added in [issue 9815](http://bugs.python.org/issue9815) slightly later.

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




More information about the pypy-issue mailing list