Allow numbers in to_constant

Enums aren't effected if a int is passed along with the string.
This commit is contained in:
Adriel Velazquez 2016-05-20 14:30:56 -04:00
parent b431bfe477
commit 22b8b90fab

View File

@ -18,4 +18,4 @@ def to_snake_case(name):
def to_const(string):
return re.sub('[\W|^(?=\d)]+', '_', string).upper()
return re.sub('[\W|^]+', '_', string).upper()