Commits

Anonymous committed d979bce Draft

removed escaping/unescaping of unknown escape seq's

Comments (0)

Files changed (1)

     Escapes the characters ``\\\\``, ``\\t``, ``\\n``, ``\\r`` and ``"`` in
     the given string ``st`` and returns it.
     """
-    return st.replace('\\', r'\\')\
-             .replace('\t', r'\t')\
+    return st.replace('\t', r'\t')\
              .replace('\r', r'\r')\
              .replace('\n', r'\n')\
              .replace('\"', r'\"')
         if m == '\\':
             return '\\'
         return m # handles escaped double quote
-    return re.sub(r'\\(\\|n|t|r|")', unescape_repl, st)
+    return re.sub(r'\\(n|t|r|")', unescape_repl, st)
 
 # }}}
 # class _BaseFile {{{