Create the dbm package from PEP 3108. #2881.
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index 6c201c9..88c85b5 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -294,8 +294,8 @@
 # Modules that provide persistent dictionary-like semantics.  You will
 # probably want to arrange for at least one of them to be available on
 # your machine, though none are defined by default because of library
-# dependencies.  The Python module anydbm.py provides an
-# implementation independent wrapper for these; dumbdbm.py provides
+# dependencies.  The Python module dbm/__init__.py provides an
+# implementation independent wrapper for these; dbm/dumb.py provides
 # similar functionality (but slower of course) implemented in Python.
 
 # The standard Unix dbm module has been moved to Setup.config so that
@@ -305,13 +305,13 @@
 #
 # First, look at Setup.config; configure may have set this for you.
 
-#dbm dbmmodule.c 	# dbm(3) may require -lndbm or similar
+#_dbm _dbmmodule.c 	# dbm(3) may require -lndbm or similar
 
 # Anthony Baxter's gdbm module.  GNU dbm(3) will require -lgdbm:
 #
 # First, look at Setup.config; configure may have set this for you.
 
-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
+#_gdbm _gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
 
 
 # Sleepycat Berkeley DB interface.
diff --git a/Modules/dbmmodule.c b/Modules/_dbmmodule.c
similarity index 98%
rename from Modules/dbmmodule.c
rename to Modules/_dbmmodule.c
index 875f0e7..1a49e24 100644
--- a/Modules/dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -332,7 +332,7 @@
 
 static PyTypeObject Dbmtype = {
 	PyVarObject_HEAD_INIT(NULL, 0)
-	"dbm.dbm",
+	"_dbm.dbm",
 	sizeof(dbmobject),
 	0,
 	(destructor)dbm_dealloc,  /*tp_dealloc*/
@@ -391,17 +391,17 @@
 };
 
 PyMODINIT_FUNC
-initdbm(void) {
+init_dbm(void) {
 	PyObject *m, *d, *s;
 
 	if (PyType_Ready(&Dbmtype) < 0)
 		return;
-	m = Py_InitModule("dbm", dbmmodule_methods);
+	m = Py_InitModule("_dbm", dbmmodule_methods);
 	if (m == NULL)
 		return;
 	d = PyModule_GetDict(m);
 	if (DbmError == NULL)
-		DbmError = PyErr_NewException("dbm.error", NULL, NULL);
+		DbmError = PyErr_NewException("_dbm.error", NULL, NULL);
 	s = PyUnicode_FromString(which_dbm);
 	if (s != NULL) {
 		PyDict_SetItemString(d, "library", s);
diff --git a/Modules/gdbmmodule.c b/Modules/_gdbmmodule.c
similarity index 98%
rename from Modules/gdbmmodule.c
rename to Modules/_gdbmmodule.c
index a8abbd3..4404d2f 100644
--- a/Modules/gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -389,7 +389,7 @@
 
 static PyTypeObject Dbmtype = {
     PyVarObject_HEAD_INIT(0, 0)
-    "gdbm.gdbm",
+    "_gdbm.gdbm",
     sizeof(dbmobject),
     0,
     (destructor)dbm_dealloc,            /*tp_dealloc*/
@@ -512,18 +512,18 @@
 };
 
 PyMODINIT_FUNC
-initgdbm(void) {
+init_gdbm(void) {
     PyObject *m, *d, *s;
 
     if (PyType_Ready(&Dbmtype) < 0)
 	    return;
-    m = Py_InitModule4("gdbm", dbmmodule_methods,
+    m = Py_InitModule4("_gdbm", dbmmodule_methods,
                        gdbmmodule__doc__, (PyObject *)NULL,
                        PYTHON_API_VERSION);
     if (m == NULL)
 	return;
     d = PyModule_GetDict(m);
-    DbmError = PyErr_NewException("gdbm.error", NULL, NULL);
+    DbmError = PyErr_NewException("_gdbm.error", NULL, NULL);
     if (DbmError != NULL) {
         PyDict_SetItemString(d, "error", DbmError);
         s = PyUnicode_FromString(dbmmodule_open_flags);
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 971ff56..5b8fc98 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -127,7 +127,7 @@
 
 static PyTypeObject Locktype = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"thread.lock",			/*tp_name*/
+	"_thread.lock",			/*tp_name*/
 	sizeof(lockobject),		/*tp_size*/
 	0,				/*tp_itemsize*/
 	/* methods */
@@ -336,7 +336,7 @@
 
 static PyTypeObject localtype = {
 	PyVarObject_HEAD_INIT(NULL, 0)
-	/* tp_name           */ "thread._local",
+	/* tp_name           */ "_thread._local",
 	/* tp_basicsize      */ sizeof(localobject),
 	/* tp_itemsize       */ 0,
 	/* tp_dealloc        */ (destructor)local_dealloc,