Added module stub for copy_reg renaming in 3.0.
Renamed copy_reg to copyreg in the standard library, to avoid
spurious warnings and ease later merging to py3k branch. Public
documentation remains intact.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 54ad714..4dfd39e 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3058,31 +3058,31 @@
 
 
 /* Stuff to implement __reduce_ex__ for pickle protocols >= 2.
-   We fall back to helpers in copy_reg for:
+   We fall back to helpers in copyreg for:
    - pickle protocols < 2
    - calculating the list of slot names (done only once per class)
    - the __newobj__ function (which is used as a token but never called)
 */
 
 static PyObject *
-import_copy_reg(void)
+import_copyreg(void)
 {
-	static PyObject *copy_reg_str;
+	static PyObject *copyreg_str;
 
-	if (!copy_reg_str) {
-		copy_reg_str = PyString_InternFromString("copy_reg");
-		if (copy_reg_str == NULL)
+	if (!copyreg_str) {
+		copyreg_str = PyString_InternFromString("copyreg");
+		if (copyreg_str == NULL)
 			return NULL;
 	}
 
-	return PyImport_Import(copy_reg_str);
+	return PyImport_Import(copyreg_str);
 }
 
 static PyObject *
 slotnames(PyObject *cls)
 {
 	PyObject *clsdict;
-	PyObject *copy_reg;
+	PyObject *copyreg;
 	PyObject *slotnames;
 
 	if (!PyType_Check(cls)) {
@@ -3097,12 +3097,12 @@
 		return slotnames;
 	}
 
-	copy_reg = import_copy_reg();
-	if (copy_reg == NULL)
+	copyreg = import_copyreg();
+	if (copyreg == NULL)
 		return NULL;
 
-	slotnames = PyObject_CallMethod(copy_reg, "_slotnames", "O", cls);
-	Py_DECREF(copy_reg);
+	slotnames = PyObject_CallMethod(copyreg, "_slotnames", "O", cls);
+	Py_DECREF(copyreg);
 	if (slotnames != NULL &&
 	    slotnames != Py_None &&
 	    !PyList_Check(slotnames))
@@ -3123,7 +3123,7 @@
 	PyObject *args = NULL, *args2 = NULL;
 	PyObject *getstate = NULL, *state = NULL, *names = NULL;
 	PyObject *slots = NULL, *listitems = NULL, *dictitems = NULL;
-	PyObject *copy_reg = NULL, *newobj = NULL, *res = NULL;
+	PyObject *copyreg = NULL, *newobj = NULL, *res = NULL;
 	Py_ssize_t i, n;
 
 	cls = PyObject_GetAttrString(obj, "__class__");
@@ -3218,10 +3218,10 @@
 			goto end;
 	}
 
-	copy_reg = import_copy_reg();
-	if (copy_reg == NULL)
+	copyreg = import_copyreg();
+	if (copyreg == NULL)
 		goto end;
-	newobj = PyObject_GetAttrString(copy_reg, "__newobj__");
+	newobj = PyObject_GetAttrString(copyreg, "__newobj__");
 	if (newobj == NULL)
 		goto end;
 
@@ -3248,7 +3248,7 @@
 	Py_XDECREF(names);
 	Py_XDECREF(listitems);
 	Py_XDECREF(dictitems);
-	Py_XDECREF(copy_reg);
+	Py_XDECREF(copyreg);
 	Py_XDECREF(newobj);
 	return res;
 }
@@ -3271,17 +3271,17 @@
 static PyObject *
 _common_reduce(PyObject *self, int proto)
 {
-	PyObject *copy_reg, *res;
+	PyObject *copyreg, *res;
 
 	if (proto >= 2)
 		return reduce_2(self);
 
-	copy_reg = import_copy_reg();
-	if (!copy_reg)
+	copyreg = import_copyreg();
+	if (!copyreg)
 		return NULL;
 
-	res = PyEval_CallMethod(copy_reg, "_reduce_ex", "(Oi)", self, proto);
-	Py_DECREF(copy_reg);
+	res = PyEval_CallMethod(copyreg, "_reduce_ex", "(Oi)", self, proto);
+	Py_DECREF(copyreg);
 
 	return res;
 }