[Python-checkins] r72300 - in python/branches/py3k: Misc/NEWS Modules/_hashopenssl.c Modules/pwdmodule.c Modules/sha256module.c Modules/sha512module.c

benjamin.peterson python-checkins at python.org
Tue May 5 00:25:22 CEST 2009


Author: benjamin.peterson
Date: Tue May  5 00:25:21 2009
New Revision: 72300

Log:
remove old undocumented compat interfaces in hashlib and pwd #5881

Modified:
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Modules/_hashopenssl.c
   python/branches/py3k/Modules/pwdmodule.c
   python/branches/py3k/Modules/sha256module.c
   python/branches/py3k/Modules/sha512module.c

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Tue May  5 00:25:21 2009
@@ -176,6 +176,9 @@
 Extension Modules
 -----------------
 
+- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
+  pwd.
+
 - Issue #5463: In struct module, remove deprecated float coercion
   for integer type codes: struct.pack('L', 0.3) should now raise
   an error.  The _PY_STRUCT_FLOAT_COERCE constant has been removed.

Modified: python/branches/py3k/Modules/_hashopenssl.c
==============================================================================
--- python/branches/py3k/Modules/_hashopenssl.c	(original)
+++ python/branches/py3k/Modules/_hashopenssl.c	Tue May  5 00:25:21 2009
@@ -281,12 +281,6 @@
      (getter)EVP_get_block_size, NULL,
      NULL,
      NULL},
-    /* the old md5 and sha modules support 'digest_size' as in PEP 247.
-     * the old sha module also supported 'digestsize'.  ugh. */
-    {"digestsize",
-     (getter)EVP_get_digest_size, NULL,
-     NULL,
-     NULL},
     {NULL}  /* Sentinel */
 };
 

Modified: python/branches/py3k/Modules/pwdmodule.c
==============================================================================
--- python/branches/py3k/Modules/pwdmodule.c	(original)
+++ python/branches/py3k/Modules/pwdmodule.c	Tue May  5 00:25:21 2009
@@ -203,13 +203,12 @@
 	if (m == NULL)
     		return NULL;
 
-	if (!initialized)
+	if (!initialized) {
 		PyStructSequence_InitType(&StructPwdType, 
 					  &struct_pwd_type_desc);
+		initialized = 1;
+	}
 	Py_INCREF((PyObject *) &StructPwdType);
 	PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType);
-	/* And for b/w compatibility (this was defined by mistake): */
-	PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType);
-	initialized = 1;
 	return m;
 }

Modified: python/branches/py3k/Modules/sha256module.c
==============================================================================
--- python/branches/py3k/Modules/sha256module.c	(original)
+++ python/branches/py3k/Modules/sha256module.c	Tue May  5 00:25:21 2009
@@ -533,9 +533,6 @@
 
 static PyMemberDef SHA_members[] = {
     {"digest_size", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL},
-    /* the old md5 and sha modules support 'digest_size' as in PEP 247.
-     * the old sha module also supported 'digestsize'.  ugh. */
-    {"digestsize", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL},
     {NULL}  /* Sentinel */
 };
 

Modified: python/branches/py3k/Modules/sha512module.c
==============================================================================
--- python/branches/py3k/Modules/sha512module.c	(original)
+++ python/branches/py3k/Modules/sha512module.c	Tue May  5 00:25:21 2009
@@ -599,9 +599,6 @@
 
 static PyMemberDef SHA_members[] = {
     {"digest_size", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL},
-    /* the old md5 and sha modules support 'digest_size' as in PEP 247.
-     * the old sha module also supported 'digestsize'.  ugh. */
-    {"digestsize", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL},
     {NULL}  /* Sentinel */
 };
 


More information about the Python-checkins mailing list