Permalink
Browse files

Correct references to string.letters and string.translate not caught …

…by 2to3
  • Loading branch information...
rtyler committed Dec 28, 2009
1 parent 0900226 commit ed60164ecb50ebc955321a8fde8d78fcc4960880
Showing with 9 additions and 4 deletions.
  1. +9 −4 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)

0 comments on commit ed60164

Please sign in to comment.