diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2001-11-02 21:41:00 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2001-11-02 21:41:00 (GMT) |
commit | 75fec2c8edd4cc673abf44d032ede17a63657ec1 (patch) | |
tree | b6ecbeda6642e3552b5380f24dc4b429c8d6043c /Modules/shamodule.c | |
parent | a73f78b6ec9ae578aa030f65314d4b0d6ac34981 (diff) | |
download | cpython-75fec2c8edd4cc673abf44d032ede17a63657ec1.zip cpython-75fec2c8edd4cc673abf44d032ede17a63657ec1.tar.gz cpython-75fec2c8edd4cc673abf44d032ede17a63657ec1.tar.bz2 |
[Patch #476612] Add attributes from PEP247 to the md5 and sha modules
Diffstat (limited to 'Modules/shamodule.c')
-rw-r--r-- | Modules/shamodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/shamodule.c b/Modules/shamodule.c index 8bfcec7..724f6d6 100644 --- a/Modules/shamodule.c +++ b/Modules/shamodule.c @@ -5,7 +5,7 @@ /* See below for information about the original code this module was based upon. Additional work performed by: - Andrew Kuchling (amk1@bigfoot.com) + Andrew Kuchling (akuchlin@mems-exchange.org) Greg Stein (gstein@lyra.org) */ @@ -458,8 +458,8 @@ SHA_getattr(PyObject *self, char *name) { if (strcmp(name, "blocksize")==0) return PyInt_FromLong(1); - if (strcmp(name, "digestsize")==0) - return PyInt_FromLong(20); + if (strcmp(name, "digest_size")==0 || strcmp(name, "digestsize")==0) + return PyInt_FromLong(20); return Py_FindMethod(SHA_methods, self, name); } @@ -542,4 +542,5 @@ initsha(void) functions require an integral number of blocks */ insint("digestsize", 20); + insint("digest_size", 20); } |