remove old undocumented compat interfaces in hashlib and pwd #5881
authorBenjamin Peterson <benjamin@python.org>
Mon, 4 May 2009 22:25:21 +0000 (22:25 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 4 May 2009 22:25:21 +0000 (22:25 +0000)
Misc/NEWS
Modules/_hashopenssl.c
Modules/pwdmodule.c
Modules/sha256module.c
Modules/sha512module.c

index a92164b9d7137add5f0953c222b1fead625a2c41..81adc944bba75da83415c98b3f95f9542fa09cb3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -176,6 +176,9 @@ Library
 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.
index 0dae5158d51665b10b218f2b772623cd7573041e..ae743946b16125d8c3d6bdb110445ec07d9931fe 100644 (file)
@@ -281,12 +281,6 @@ static PyGetSetDef EVP_getseters[] = {
      (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 */
 };
 
index cb99183f27c2bd60e511c471f89ba90666b19b27..061a0a5254fb04684ab8fce14f3eeb7dcc3a6aa7 100644 (file)
@@ -203,13 +203,12 @@ PyInit_pwd(void)
        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;
 }
index 7c9b58d400ddd46a1d679cfe5684bb30bcad4e95..a9ac748b62eca5fd17ca49113b4d59e9fbc8b58e 100644 (file)
@@ -533,9 +533,6 @@ static PyGetSetDef SHA_getseters[] = {
 
 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 */
 };
 
index 387187f631d0dbe4005601531ed3ab7dc2ff14d8..e29ddecbf85dae33b82a330e85d83385986ac770 100644 (file)
@@ -599,9 +599,6 @@ static PyGetSetDef SHA_getseters[] = {
 
 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 */
 };