~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

Viewing changes to Lib/test/leakers/test_ctypes.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test().
 
3
# When this leak is fixed, remember to remove from Misc/build.sh LEAKY_TESTS.
 
4
 
 
5
from ctypes import Structure, c_int, POINTER
 
6
import gc
 
7
 
 
8
def leak_inner():
 
9
    class POINT(Structure):
 
10
        _fields_ = [("x", c_int)]
 
11
    class RECT(Structure):
 
12
        _fields_ = [("a", POINTER(POINT))]
 
13
 
 
14
def leak():
 
15
    leak_inner()
 
16
    gc.collect()