summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@monkeypox.org>2009-11-16 10:44:43 -0800
committerR. Tyler Ballance <tyler@monkeypox.org>2009-11-16 10:44:43 -0800
commite43765a679b84c52df875e9629d303e304af50a1 (patch)
treee8c275b8d9edfcb55af6706da64d90eae57b5c8c
parent47fbe57de8fc7fab20fd2d6b381ffbae411b74bc (diff)
downloadpython-cheetah-e43765a679b84c52df875e9629d303e304af50a1.tar.gz
Prevent Template.compile() from creating classnames with numerous leading underscores
Issue originally reported by Kirill Uhanov <kirill.uhanov@intel.com> on the mailing list (see: "problem with include directive on cheetah 2.4.0")
-rw-r--r--cheetah/Template.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cheetah/Template.py b/cheetah/Template.py
index 2b789e7..430a863 100644
--- a/cheetah/Template.py
+++ b/cheetah/Template.py
@@ -640,7 +640,7 @@ class Template(Servlet):
if not isinstance(className, (types.NoneType, basestring)):
raise TypeError(errmsg % ('className', 'string or None'))
- className = className or moduleName
+ className = re.sub(r'^_+','', className or moduleName)
if mainMethodName is Unspecified:
mainMethodName = klass._CHEETAH_defaultMainMethodNameForTemplates