PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Python | 25 lines | 16 code | 9 blank | 0 comment | 4 complexity | 252de2e97e95297748c9481ea1a1d707 MD5 | raw file
 1from disown import *
 2
 3a = A()
 4
 5tmp = a.thisown
 6
 7a.thisown = 0
 8if a.thisown:
 9    raise RuntimeError
10
11a.thisown = 1
12if (not a.thisown):
13    raise RuntimeError
14
15a.thisown = tmp
16if (a.thisown != tmp):
17    raise RuntimeError    
18
19
20b = B()
21
22b.acquire(a)
23
24if a.thisown:
25    raise RuntimeError