diff options
author | Fred Drake <fdrake@acm.org> | 2001-07-20 19:05:50 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-07-20 19:05:50 +0000 |
commit | 79e75e1916c33ee8e3de4c1b6c38221f2dba315c (patch) | |
tree | 96e3e40993ba8b5e4123470493e36797b3b10fdd | |
parent | f69868f304cb2198e4f43e73d5d8873d7222cda8 (diff) | |
download | cpython-git-79e75e1916c33ee8e3de4c1b6c38221f2dba315c.tar.gz |
Use string.ascii_letters instead of string.letters (SF bug #226706).
-rwxr-xr-x | Demo/pdist/rcslib.py | 2 | ||||
-rw-r--r-- | Lib/Cookie.py | 2 | ||||
-rw-r--r-- | Lib/cmd.py | 2 | ||||
-rw-r--r-- | Lib/dospath.py | 2 | ||||
-rw-r--r-- | Lib/lib-old/codehack.py | 2 | ||||
-rw-r--r-- | Lib/ntpath.py | 2 | ||||
-rw-r--r-- | Lib/plat-riscos/riscospath.py | 2 | ||||
-rw-r--r-- | Lib/test/test_mimetools.py | 2 | ||||
-rw-r--r-- | Lib/tokenize.py | 2 | ||||
-rw-r--r-- | Mac/Tools/IDE/PyEdit.py | 3 | ||||
-rw-r--r-- | Mac/scripts/gensuitemodule.py | 2 | ||||
-rw-r--r-- | Tools/idle/AutoExpand.py | 2 | ||||
-rw-r--r-- | Tools/idle/UndoDelegator.py | 2 | ||||
-rwxr-xr-x | Tools/scripts/fixheader.py | 2 | ||||
-rwxr-xr-x | Tools/scripts/texi2html.py | 6 |
15 files changed, 17 insertions, 18 deletions
diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py index 5e79247cb3..6d2e313543 100755 --- a/Demo/pdist/rcslib.py +++ b/Demo/pdist/rcslib.py @@ -33,7 +33,7 @@ class RCS: """ # Characters allowed in work file names - okchars = string.letters + string.digits + '-_=+.' + okchars = string.ascii_letters + string.digits + '-_=+' def __init__(self): """Constructor.""" diff --git a/Lib/Cookie.py b/Lib/Cookie.py index dd116b7310..3fc2ffc1dd 100644 --- a/Lib/Cookie.py +++ b/Lib/Cookie.py @@ -249,7 +249,7 @@ class CookieError(Exception): # _LegalChars is the list of chars which don't require "'s # _Translator hash-table for fast quoting # -_LegalChars = string.letters + string.digits + "!#$%&'*+-.^_`|~" +_LegalChars = string.ascii_letters + string.digits + "!#$%&'*+-.^_`|~" _Translator = { '\000' : '\\000', '\001' : '\\001', '\002' : '\\002', '\003' : '\\003', '\004' : '\\004', '\005' : '\\005', diff --git a/Lib/cmd.py b/Lib/cmd.py index 10c11a2221..eacd498906 100644 --- a/Lib/cmd.py +++ b/Lib/cmd.py @@ -40,7 +40,7 @@ import string, sys __all__ = ["Cmd"] PROMPT = '(Cmd) ' -IDENTCHARS = string.letters + string.digits + '_' +IDENTCHARS = string.ascii_letters + string.digits + '_' class Cmd: prompt = PROMPT diff --git a/Lib/dospath.py b/Lib/dospath.py index ed35d5970b..958f9f69b0 100644 --- a/Lib/dospath.py +++ b/Lib/dospath.py @@ -241,7 +241,7 @@ def expandvars(path): if '$' not in path: return path import string - varchars = string.letters + string.digits + '_-' + varchars = string.ascii_letters + string.digits + "_-" res = '' index = 0 pathlen = len(path) diff --git a/Lib/lib-old/codehack.py b/Lib/lib-old/codehack.py index 52ac6be2d9..248205bffa 100644 --- a/Lib/lib-old/codehack.py +++ b/Lib/lib-old/codehack.py @@ -31,7 +31,7 @@ import linecache # Because this is a pretty expensive hack, a cache is kept. SET_LINENO = 127 # The opcode (see "opcode.h" in the Python source) -identchars = string.letters + string.digits + '_' # Identifier characters +identchars = string.ascii_letters + string.digits + '_' # Identifier characters _namecache = {} # The cache diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 13de59bdca..d81e8fb645 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -334,7 +334,7 @@ def expandvars(path): if '$' not in path: return path import string - varchars = string.letters + string.digits + '_-' + varchars = string.ascii_letters + string.digits + '_-' res = '' index = 0 pathlen = len(path) diff --git a/Lib/plat-riscos/riscospath.py b/Lib/plat-riscos/riscospath.py index d55a8b83ea..32f39ba729 100644 --- a/Lib/plat-riscos/riscospath.py +++ b/Lib/plat-riscos/riscospath.py @@ -62,7 +62,7 @@ def _split(p): s= q # find end of main FS name, not including special field else: for c in p[dash:s]: - if c not in string.letters: + if c not in string.ascii_letters: q= 0 break # disallow invalid non-special-field characters in FS name r= q diff --git a/Lib/test/test_mimetools.py b/Lib/test/test_mimetools.py index 4ee11a10f3..0300714d76 100644 --- a/Lib/test/test_mimetools.py +++ b/Lib/test/test_mimetools.py @@ -2,7 +2,7 @@ from test_support import TestFailed import mimetools import string,StringIO -start = string.letters + "=" + string.digits + "\n" +start = string.ascii_letters + "=" + string.digits + "\n" for enc in ['7bit','8bit','base64','quoted-printable']: print enc, i = StringIO.StringIO(start) diff --git a/Lib/tokenize.py b/Lib/tokenize.py index cbe45529c2..33c5e41d7a 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -133,7 +133,7 @@ def tokenize_loop(readline, tokeneater): def generate_tokens(readline): lnum = parenlev = continued = 0 - namechars, numchars = string.letters + '_', string.digits + namechars, numchars = string.ascii_letters + '_', '0123456789' contstr, needcont = '', 0 contline = None indents = [0] diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index 10f583faee..d8539c1ef9 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -25,8 +25,7 @@ else: haveThreading = Wthreading.haveThreading _scriptuntitledcounter = 1 -# _wordchars = string.letters + string.digits + "_" -_wordchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_' +_wordchars = string.ascii_letters + string.digits + "_" runButtonLabels = ["Run all", "Stop!"] diff --git a/Mac/scripts/gensuitemodule.py b/Mac/scripts/gensuitemodule.py index b68def78d0..6549ed2a03 100644 --- a/Mac/scripts/gensuitemodule.py +++ b/Mac/scripts/gensuitemodule.py @@ -825,7 +825,7 @@ def identify(str): if not str: return "_empty_ae_name" rv = '' - ok = string.letters + '_' + ok = string.ascii_letters + '_' ok2 = ok + string.digits for c in str: if c in ok: diff --git a/Tools/idle/AutoExpand.py b/Tools/idle/AutoExpand.py index 09f34b38d9..40d39f3f42 100644 --- a/Tools/idle/AutoExpand.py +++ b/Tools/idle/AutoExpand.py @@ -21,7 +21,7 @@ class AutoExpand: ]), ] - wordchars = string.letters + string.digits + "_" + wordchars = string.ascii_letters + string.digits + "_" def __init__(self, editwin): self.text = editwin.text diff --git a/Tools/idle/UndoDelegator.py b/Tools/idle/UndoDelegator.py index ec7af81bcd..3ef14c30ef 100644 --- a/Tools/idle/UndoDelegator.py +++ b/Tools/idle/UndoDelegator.py @@ -251,7 +251,7 @@ class InsertCommand(Command): self.chars = self.chars + cmd.chars return 1 - alphanumeric = string.letters + string.digits + "_" + alphanumeric = string.ascii_letters + string.digits + "_" def classify(self, c): if c in self.alphanumeric: diff --git a/Tools/scripts/fixheader.py b/Tools/scripts/fixheader.py index 9b65a44fb0..ba2e0c503b 100755 --- a/Tools/scripts/fixheader.py +++ b/Tools/scripts/fixheader.py @@ -29,7 +29,7 @@ def process(file): sys.stderr.write('Processing %s ...\n' % file) magic = 'Py_' for c in file: - if c in string.letters + string.digits: + if c in string.ascii_letters + string.digits: magic = magic + string.upper(c) else: magic = magic + '_' sys.stdout = f diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py index dfe96db2e7..f3e7fb3931 100755 --- a/Tools/scripts/texi2html.py +++ b/Tools/scripts/texi2html.py @@ -422,7 +422,7 @@ class TexinfoParser: # Cannot happen unless spprog is changed raise RuntimeError, 'unexpected funny '+`c` start = i - while i < n and text[i] in string.letters: i = i+1 + while i < n and text[i] in string.ascii_letters: i = i+1 if i == start: # @ plus non-letter: literal next character i = i+1 @@ -1260,7 +1260,7 @@ class TexinfoParser: if self.itemindex: self.index(self.itemindex, args) if self.itemarg: if self.itemarg[0] == '@' and self.itemarg[1:2] and \ - self.itemarg[1] in string.letters: + self.itemarg[1] in string.ascii_letters: args = self.itemarg + '{' + args + '}' else: # some other character, e.g. '-' @@ -1524,7 +1524,7 @@ def makefile(nodename): # Characters that are perfectly safe in filenames and hyperlinks -goodchars = string.letters + string.digits + '!@-=+.' +goodchars = string.ascii_letters + string.digits + '!@-=+.' # Replace characters that aren't perfectly safe by dashes # Underscores are bad since Cern HTTPD treats them as delimiters for |