_slotnames(): exclude __dict__ and __weakref__; these aren't real
slots even though they can be listed in __slots__.
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 0d553a7..05772b0 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -881,7 +881,8 @@
     names = []
     for c in cls.__mro__:
         if "__slots__" in c.__dict__:
-            names += list(c.__dict__["__slots__"])
+            names += [name for name in c.__dict__["__slots__"]
+                           if name not in ("__dict__", "__weakref__")]
     return names
 
 def _keep_alive(x, memo):