/trunk/Examples/test-suite/python/disown_runme.py

# · Python · 25 lines · 16 code · 9 blank · 0 comment · 4 complexity · 252de2e97e95297748c9481ea1a1d707 MD5 · raw file

  1. from disown import *
  2. a = A()
  3. tmp = a.thisown
  4. a.thisown = 0
  5. if a.thisown:
  6. raise RuntimeError
  7. a.thisown = 1
  8. if (not a.thisown):
  9. raise RuntimeError
  10. a.thisown = tmp
  11. if (a.thisown != tmp):
  12. raise RuntimeError
  13. b = B()
  14. b.acquire(a)
  15. if a.thisown:
  16. raise RuntimeError