Staging
v0.5.1
https://github.com/python/cpython
Revision 596db3161c8cf0a492f5613cb5721b6c12c1dceb authored by Fred Drake on 06 October 1997, 15:48:20 UTC, committed by Fred Drake on 06 October 1997, 15:48:20 UTC
This allows stuff like this out of the box:

	try:
	    ...
	except socket.error, (code, msg):
	    ...
1 parent bf9d353
Raw File
Tip revision: 596db3161c8cf0a492f5613cb5721b6c12c1dceb authored by Fred Drake on 06 October 1997, 15:48:20 UTC
Move the __getitem__() definition from StandardException to Exception.
Tip revision: 596db31
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "config.h"
#include "myproto.h"
#include "mymalloc.h"

#include <string.h>

char *
strdup(str)
	const char *str;
{
	if (str != NULL) {
		register char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top