]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use string.ascii_letters instead of string.letters (SF bug #226706).
authorFred Drake <fdrake@acm.org>
Fri, 20 Jul 2001 19:05:50 +0000 (19:05 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 20 Jul 2001 19:05:50 +0000 (19:05 +0000)
15 files changed:
Demo/pdist/rcslib.py
Lib/Cookie.py
Lib/cmd.py
Lib/dospath.py
Lib/lib-old/codehack.py
Lib/ntpath.py
Lib/plat-riscos/riscospath.py
Lib/test/test_mimetools.py
Lib/tokenize.py
Mac/Tools/IDE/PyEdit.py
Mac/scripts/gensuitemodule.py
Tools/idle/AutoExpand.py
Tools/idle/UndoDelegator.py
Tools/scripts/fixheader.py
Tools/scripts/texi2html.py

index 5e79247cb3670fba707b2601c61f2d62ff531b4a..6d2e313543d9f88aee36e8c4a1448a23f4dd1ce3 100755 (executable)
@@ -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."""
index dd116b73104ad3b3faee92d86eb4f20ce3741afd..3fc2ffc1dd603532368a63ba4cf9aef0cee7303e 100644 (file)
@@ -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',
index 10c11a22214cfa044e8fb8bdc949a65a43df4cf7..eacd498906b54d70e0dc8708b4b4e402ce16672e 100644 (file)
@@ -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
index ed35d5970b63a56eba7820577e56e04621e5e00a..958f9f69b0f776e2cc9e684a509646bb54cda21d 100644 (file)
@@ -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)
index 52ac6be2d955899f5922fcbffdb6f9f55b6b8044..248205bffab4a603dd517249b3504598cdf23b7a 100644 (file)
@@ -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
 
index 13de59bdca21575c068e77d459469a2a9b8bd85e..d81e8fb6450aea8d6afe0d08f557574a1487364d 100644 (file)
@@ -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)
index d55a8b83ea7411f1c0abbd0f9e1fd95e0aa134a2..32f39ba72963bd850bed3317db215e98ef0569e8 100644 (file)
@@ -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
index 4ee11a10f386984e0552705308e4d4b1f73bf22b..0300714d76f84a4fcf3e98b46077ceafeccf2e0a 100644 (file)
@@ -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)
index cbe45529c28f634ce60c000a1504f26dad5482af..33c5e41d7ae40d65ced3c9b3e0e2cb4eb4dfa20d 100644 (file)
@@ -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]
index 10f583faee045f5e11de8bc22c953178bcfe1fa7..d8539c1ef984b897f8206f194fa45ed2fecc464a 100644 (file)
@@ -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!"]
index b68def78d06297014906337d01b8324ef196f44b..6549ed2a0320d2a8dd38a491078fde14b8310219 100644 (file)
@@ -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:
index 09f34b38d9fbac6fa55ebf39667b621b048a8ba9..40d39f3f42618a0a30226d34e8d801fc68d81f97 100644 (file)
@@ -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
index ec7af81bcd8493dc22822c99564d1158673b8e05..3ef14c30ef671904435325afec492e2e2eb8aaae 100644 (file)
@@ -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:
index 9b65a44fb091ecf05e5d62ffb21be3af6bc75f8c..ba2e0c503b062ed042f07841ca7e4707bab6b68f 100755 (executable)
@@ -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
index dfe96db2e7b6754661939b670c268296d20b70c5..f3e7fb3931f795d7e7009c5adbb1ff55f8bf2c38 100755 (executable)
@@ -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