Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…by 2to3
  • Loading branch information...
commit ed60164ecb50ebc955321a8fde8d78fcc4960880 1 parent 0900226
@rtyler authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 cheetah/convertTmplPathToModuleName.py
View
13 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)
Please sign in to comment.
Something went wrong with that request. Please try again.