summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-09 19:24:53 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-09 19:24:53 (GMT)
commit644a12b00ce6a361089b488aa8096a6c86b52275 (patch)
tree73e3cfeeba809a3fc43f42d1883ebe9dffe3ffda /Python/compile.c
parent801776742082034cc6193530326af042d5af56a5 (diff)
downloadcpython-644a12b00ce6a361089b488aa8096a6c86b52275.zip
cpython-644a12b00ce6a361089b488aa8096a6c86b52275.tar.gz
cpython-644a12b00ce6a361089b488aa8096a6c86b52275.tar.bz2
Tweaks to keep the Microsoft compiler quier.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7d9a3a8..21629ab 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -182,6 +182,9 @@ typeobject Codetype = {
(hashfunc)code_hash, /*tp_hash*/
};
+#define NAME_CHARS \
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
+
codeobject *
newcodeobject(argcount, nlocals, stacksize, flags,
code, consts, names, varnames, filename, name,
@@ -237,7 +240,7 @@ newcodeobject(argcount, nlocals, stacksize, flags,
if (!is_stringobject(v))
continue;
p = getstringvalue(v);
- if (strspn(p, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
+ if ((int)strspn(p, NAME_CHARS)
!= getstringsize(v))
continue;
PyString_InternInPlace(&PyTuple_GET_ITEM(consts, i));