]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for #1087741 patch.
authorGeorg Brandl <georg@python.org>
Tue, 22 Jan 2008 19:56:03 +0000 (19:56 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 22 Jan 2008 19:56:03 +0000 (19:56 +0000)
Lib/test/test_mmap.py
Modules/mmapmodule.c

index 8cc8dedb73d565973776399cb67dcddf96a4e6a5..91d62754c08eb614184b4db275429b1d587c7118 100644 (file)
@@ -420,6 +420,13 @@ class MmapTests(unittest.TestCase):
             except OSError:
                 pass
 
+    def test_subclass(self):
+        class anon_mmap(mmap.mmap):
+            def __new__(klass, *args, **kwargs):
+                return mmap.mmap.__new__(klass, -1, *args, **kwargs)
+        anon_mmap(PAGESIZE)
+
+
 def test_main():
     run_unittest(MmapTests)
 
index dfbc8fc6e40cf0aa1186436016a9fd880b65aa8e..09e94653d80057a42d30eb345e99ca31e5a6a262 100644 (file)
@@ -129,7 +129,7 @@ mmap_object_dealloc(mmap_object *m_obj)
        }
 #endif /* UNIX */
 
-       PyObject_Del(m_obj);
+       m_obj->ob_type->tp_free((PyObject*)m_obj);
 }
 
 static PyObject *