From e3b3799737edaf0e9ecff5a08c08d16512a84254 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 15 Feb 2018 13:51:35 +0000 Subject: [PATCH] utils/misc: remove unused to_identifier This has been moved to devlib, but, it appears, never removed from WA. --- wa/utils/misc.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/wa/utils/misc.py b/wa/utils/misc.py index 926addfe..597ae984 100644 --- a/wa/utils/misc.py +++ b/wa/utils/misc.py @@ -290,14 +290,6 @@ class LoadSyntaxError(Exception): RAND_MOD_NAME_LEN = 30 -BAD_CHARS = string.punctuation + string.whitespace -TRANS_TABLE = string.maketrans(BAD_CHARS, '_' * len(BAD_CHARS)) - - -def to_identifier(text): - """Converts text to a valid Python identifier by replacing all - whitespace and punctuation.""" - return re.sub('_+', '_', text.translate(TRANS_TABLE)) def load_struct_from_python(filepath=None, text=None):