Issue 4998: restore utility of __slots__ on Fraction.
(forward merge of r68813).
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index 6851d2d..91fcd26 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -407,6 +407,11 @@
         self.assertEqual(id(r), id(copy(r)))
         self.assertEqual(id(r), id(deepcopy(r)))
 
+    def test_slots(self):
+        # Issue 4998
+        r = F(13, 7)
+        self.assertRaises(AttributeError, setattr, r, 'a', 10)
+
 def test_main():
     run_unittest(FractionTest, GcdTest)