diff options
author | Guido van Rossum <guido@python.org> | 1995-01-17 16:30:22 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-17 16:30:22 (GMT) |
commit | 0865dd9ce96de4467365ea14bea75805d8ddc8c6 (patch) | |
tree | 5db391348c863775cad862a4f169b83904e7b421 /Python/bltinmodule.c | |
parent | c3f82b6b8a1fbe34e52e3266a3932073bb714c2f (diff) | |
download | cpython-0865dd9ce96de4467365ea14bea75805d8ddc8c6.zip cpython-0865dd9ce96de4467365ea14bea75805d8ddc8c6.tar.gz cpython-0865dd9ce96de4467365ea14bea75805d8ddc8c6.tar.bz2 |
fix Alpha bug in (x)range; different __builtins__ initialization
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index b3ac3c6..dbf201e 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1011,13 +1011,13 @@ builtin_range(self, args) if (gettuplesize(args) <= 1) { if (!newgetargs(args, - "i;range() requires 1-3 int arguments", + "l;range() requires 1-3 int arguments", &ihigh)) return NULL; } else { if (!newgetargs(args, - "ii|i;range() requires 1-3 int arguments", + "ll|l;range() requires 1-3 int arguments", &ilow, &ihigh, &istep)) return NULL; } @@ -1053,18 +1053,18 @@ builtin_xrange(self, args) object *args; { long ilow = 0, ihigh = 0, istep = 1; - int n; + long n; object *v; if (gettuplesize(args) <= 1) { if (!newgetargs(args, - "i;xrange() requires 1-3 int arguments", + "l;xrange() requires 1-3 int arguments", &ihigh)) return NULL; } else { if (!newgetargs(args, - "ii|i;xrange() requires 1-3 int arguments", + "ll|l;xrange() requires 1-3 int arguments", &ilow, &ihigh, &istep)) return NULL; } @@ -1382,9 +1382,16 @@ static struct methodlist builtin_methods[] = { {NULL, NULL}, }; +static object *builtin_mod; static object *builtin_dict; object * +getbuiltinmod() +{ + return builtin_mod; +} + +object * getbuiltindict() { return builtin_dict; @@ -1449,9 +1456,8 @@ initerrors() void initbuiltin() { - object *m; - m = initmodule("__builtin__", builtin_methods); - builtin_dict = getmoduledict(m); + builtin_mod = initmodule("__builtin__", builtin_methods); + builtin_dict = getmoduledict(builtin_mod); INCREF(builtin_dict); initerrors(); (void) dictinsert(builtin_dict, "None", None); |