diff options
author | R. Tyler Ballance <tyler@monkeypox.org> | 2009-12-27 16:58:45 -0800 |
---|---|---|
committer | R. Tyler Ballance <tyler@monkeypox.org> | 2009-12-27 16:58:45 -0800 |
commit | ed60164ecb50ebc955321a8fde8d78fcc4960880 (patch) | |
tree | 490e147e98ff1685309e9d8c93d17329da8fdeee /cheetah | |
parent | 0900226c99b77d633410b1aaeb6cdc4ca9b625a2 (diff) | |
download | python-cheetah-ed60164ecb50ebc955321a8fde8d78fcc4960880.tar.gz |
Correct references to string.letters and string.translate not caught by 2to3
Diffstat (limited to 'cheetah')
-rw-r--r-- | cheetah/convertTmplPathToModuleName.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cheetah/convertTmplPathToModuleName.py b/cheetah/convertTmplPathToModuleName.py index 4f9d8ea..264f18e 100644 --- a/cheetah/convertTmplPathToModuleName.py +++ b/cheetah/convertTmplPathToModuleName.py @@ -1,15 +1,20 @@ import os.path import string +letters = None +try: + letters = string.ascii_letters +except AttributeError: + letters = string.letters + l = ['_'] * 256 -for c in string.digits + string.letters: +for c in string.digits + letters: l[ord(c)] = c -_pathNameTransChars = string.join(l, '') +_pathNameTransChars = ''.join(l) del l, c def convertTmplPathToModuleName(tmplPath, _pathNameTransChars=_pathNameTransChars, splitdrive=os.path.splitdrive, - translate=string.translate, ): - return translate(splitdrive(tmplPath)[1], _pathNameTransChars) + return splitdrive(tmplPath)[1].translate(_pathNameTransChars) |