Skip to content

Loading…

Avoid creating an invalid class name #3

Merged
merged 1 commit into from

2 participants

@mikola

Avoid creating an invalid class name for the file on the path where the first folder name starts with a number, e.g. c:\10folder\code\sample.tmpl.

@mikola mikola Avoid creating an invalid class name for the file on the path where t…
…he first folder name starts with a number, e.g. c:\10folder\code\sample.tmpl
317118d
@rtyler rtyler merged commit 831aa6b into cheetahtemplate:master
@rtyler
Collaborator

In general, I think bug fixes like this are nice to have with tests, but I'll take it anyways :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 22, 2012
  1. @mikola

    Avoid creating an invalid class name for the file on the path where t…

    mikola committed
    …he first folder name starts with a number, e.g. c:\10folder\code\sample.tmpl
Showing with 1 addition and 1 deletion.
  1. +1 −1 cheetah/Template.py
View
2 cheetah/Template.py
@@ -644,7 +644,7 @@ def __str__(self): return self.respond()
if not isinstance(className, (types.NoneType, basestring)):
raise TypeError(errmsg % ('className', 'string or None'))
- className = re.sub(r'^_+','', className or moduleName)
+ className = re.sub(r'^_+([^0-9])',r'\1', className or moduleName)
if mainMethodName is Unspecified:
mainMethodName = klass._CHEETAH_defaultMainMethodNameForTemplates
Something went wrong with that request. Please try again.