Issue #8268: Old-style classes (not just instances) now support weak
references.
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index d106fe7..1720875 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -544,7 +544,7 @@
         class class_oldstyle():
             def method():
                 pass
-        check(class_oldstyle, size(h + '6P'))
+        check(class_oldstyle, size(h + '7P'))
         # instance (old-style class)
         check(class_oldstyle(), size(h + '3P'))
         # instancemethod (old-style class)
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 536a987..bc2982f 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -685,6 +685,26 @@
         # No exception should be raised here
         gc.collect()
 
+    def test_classes(self):
+        # Check that both old-style classes and new-style classes
+        # are weakrefable.
+        class A(object):
+            pass
+        class B:
+            pass
+        l = []
+        weakref.ref(int)
+        a = weakref.ref(A, l.append)
+        A = None
+        gc.collect()
+        self.assertEqual(a(), None)
+        self.assertEqual(l, [a])
+        b = weakref.ref(B, l.append)
+        B = None
+        gc.collect()
+        self.assertEqual(b(), None)
+        self.assertEqual(l, [a, b])
+
 
 class SubclassableWeakrefTestCase(TestBase):