summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/modulator.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-07-20 18:58:42 (GMT)
committerFred Drake <fdrake@acm.org>2001-07-20 18:58:42 (GMT)
commitcd694c44a91fa20e6d2ee540e0b517021e845e79 (patch)
tree7ad24f37013f88e8ac081257c024d8db48a3ca27 /Tools/modulator/modulator.py
parent0f715d2aa119d0391dd50919c04bfaa8a4452cf0 (diff)
downloadcpython-cd694c44a91fa20e6d2ee540e0b517021e845e79.zip
cpython-cd694c44a91fa20e6d2ee540e0b517021e845e79.tar.gz
cpython-cd694c44a91fa20e6d2ee540e0b517021e845e79.tar.bz2
Use string.ascii_letters instead of string.letters (SF bug #226706).
Move computation of sets of characters out of the body of the function that uses them.
Diffstat (limited to 'Tools/modulator/modulator.py')
-rwxr-xr-xTools/modulator/modulator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Tools/modulator/modulator.py b/Tools/modulator/modulator.py
index 23a2539..add8b6a 100755
--- a/Tools/modulator/modulator.py
+++ b/Tools/modulator/modulator.py
@@ -30,13 +30,16 @@ import string
oops = 'oops'
+IDENTSTARTCHARS = string.ascii_letters + '_'
+IDENTCHARS = string.ascii_letters + string.digits + '_'
+
# Check that string is a legal C identifier
def checkid(str):
if not str: return 0
- if not str[0] in string.letters+'_':
+ if not str[0] in IDENTSTARTCHARS:
return 0
for c in str[1:]:
- if not c in string.letters+string.digits+'_':
+ if not c in IDENTCHARS:
return 0
return 1