mirror of https://github.com/python/cpython
use newgetargs
This commit is contained in:
parent
f8afdcfef0
commit
ef38b78f94
|
@ -167,13 +167,10 @@ MD5_new(self, args)
|
||||||
{
|
{
|
||||||
md5object *md5p;
|
md5object *md5p;
|
||||||
unsigned char *cp = NULL;
|
unsigned char *cp = NULL;
|
||||||
int len;
|
int len = 0;
|
||||||
|
|
||||||
if (!getargs(args, "")) {
|
if (!newgetargs(args, "|s#", &cp, &len))
|
||||||
err_clear();
|
return NULL;
|
||||||
if (!getargs(args, "s#", &cp, &len))
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((md5p = newmd5object()) == NULL)
|
if ((md5p = newmd5object()) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -188,9 +185,9 @@ MD5_new(self, args)
|
||||||
/* List of functions exported by this module */
|
/* List of functions exported by this module */
|
||||||
|
|
||||||
static struct methodlist md5_functions[] = {
|
static struct methodlist md5_functions[] = {
|
||||||
{"new", (method)MD5_new},
|
{"new", (method)MD5_new, 1},
|
||||||
{"md5", (method)MD5_new}, /* Backward compatibility */
|
{"md5", (method)MD5_new, 1}, /* Backward compatibility */
|
||||||
{NULL, NULL} /* Sentinel */
|
{NULL, NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue