1. Pypy
  2. Untitled project
  3. pypy


Antonio Cuni  committed 0278546

catch the correct exception type for both pypy and cpython

  • Participants
  • Parent commits f8df108
  • Branches py3k

Comments (0)

Files changed (1)

File pypy/module/__builtin__/test/test_descriptor.py

View file
  • Ignore whitespace
         for attr in "__doc__", "fget", "fset", "fdel":
                 setattr(raw, attr, 42)
-            except AttributeError as msg:
+            # it raises TypeError on pypy, AttributeError on CPython: we catch
+            # both so that it runs also with -A
+            except (TypeError, AttributeError) as msg:
                 if str(msg).find('readonly') < 0:
                     raise Exception("when setting readonly attr %r on a "
                                     "property, got unexpected TypeError "