def test_has_weakref_support(): assert has_weakref_support() res = interpret(lambda: has_weakref_support(), [], **{'translation.rweakref': True}) assert res == True res = interpret(lambda: has_weakref_support(), [], **{'translation.rweakref': False}) assert res == False
def add(self, w_iobase): assert w_iobase.streamholder is None if rweakref.has_weakref_support(): holder = StreamHolder(w_iobase) w_iobase.streamholder = holder self.streams[holder] = None